View Single Post
  #1 (permalink)  
Old 12-08-03, 04:50
damnnono_86 damnnono_86 is offline
Registered User
 
Join Date: Nov 2003
Posts: 74
error number 1004

hi, i am doing an exporting of data to excel file and after a period of time of testing my code, i will recieve this error :

error number 1004
error msg : Method 'Range' of object '_Global' failed

how can i solve/prevent this error??? when this error occurs, my exporting won't work. The error occurs at this line

"Excel.Range(Chr(Col) & Row).Select"

pls advice
nono

=------------------------------------------------------------------=
Do While Not rstCustData.EOF
Col = 65
Row = 1

For x = 0 To rstCustData.Fields.Count - 1

Excel.Range(Chr(Col) & Row).Select
Excel.ActiveCell = rstCustData.Fields(x)
Col = Col + 1

Next x

Row = Row + 1
Col = 65

rstCustData.MoveNext

Loop

=------------------------------------------------------------------=
Reply With Quote