Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raj Raj is offline
external usenet poster
 
Posts: 130
Default Excel 2000 : Error 1004

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.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Excel 2000 : Error 1004

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

--
Regards,
Tom Ogilvy

"raj" wrote in message
...
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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
VB6 and Excel - 1004 error news.easynews.com Excel Programming 0 June 20th 04 03:19 PM
Error 1004 in Excel 97... Mike[_81_] Excel Programming 3 May 2nd 04 03:37 AM
Error 1004 in Excel 2000 YaakovSinai Excel Programming 0 April 18th 04 03:46 PM
HELP!! Excel 2000 Copy of worksheet class failed run time Error 1004 Martin[_6_] Excel Programming 1 August 2nd 03 03:16 PM


All times are GMT +1. The time now is 07:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"