Excel 2000 : Error 1004

R

raj

I am using an array to fill the data into the Excel sheet.

It works fine for smaller size of arrays ( say 600 X 20) .

But If the data is large , then it gives '1004 : application defined or
object defined error'

The code is something like below.

Dim avsheet3 as Variant
/* some more code */
Redim avSheet3(8500, 14)
/* some more code to fill the array */
sRange = "A1:N8500"
set worksheet = workbook.worksheet(3)
worksheet.Range(sRange).value = avsheet3

It gives the error on the last line.
 
T

Tom Ogilvy

although you example is 8501 x 15 for option base 1, it still worked fine
for me:

Sub ABC()
Dim avsheet3 As Variant
'/* some more code */
ReDim avsheet3(8500, 14)
'/* some more code to fill the array */
For i = 0 To 8500
For j = 0 To 14
avsheet3(i, j) = Chr(j + 65) & i + 1
Next
Next
sRange = "A1:N8500"
Set Worksheet = ThisWorkbook.Worksheets(3)
Worksheet.Range(sRange).Value = avsheet3

End Sub


xl2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top