+ Reply to Thread
Results 1 to 2 of 2

Excel 2000 : Error 1004

  1. #1
    raj
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1