2,560 cell limit???

  • Thread starter Thread starter Joseph Czapski
  • Start date Start date
J

Joseph Czapski

Hi. I've run into Excel 2003 complaining that I'd exceeded 2,560 cells. Is
there a limit to how many cells whose values you can insert individually
programatically via Excel's object library? Thanks.

Joe Czapski
Boston, Mass.
 
I don't think so.

This worked for me:

Option Explicit
Sub testme()
ActiveSheet.Cells.Value = 1
End Sub


All 16,777,216 were changed to 1.

You may want to be a little more specific.
 
Dave Peterson said:
I don't think so.

This worked for me:

Option Explicit
Sub testme()
ActiveSheet.Cells.Value = 1
End Sub


All 16,777,216 were changed to 1.

You may want to be a little more specific.

Dave,
Thank you very much for testing that! That's good info. Did that write all
the cells at once, though? This problem has to do with updating one cell at
a time, and Show-ing each cell after it's updated, as data comes into the
computer one cell-worth at a time. After the 2,560th cell is updated, Excel
pops up a window saying that I've exceeded "2,560 cells or rows".

Joe Czapski
Boston, Mass.
 
Can you post your code?


Dave,
Thank you very much for testing that! That's good info. Did that write all
the cells at once, though? This problem has to do with updating one cell at
a time, and Show-ing each cell after it's updated, as data comes into the
computer one cell-worth at a time. After the 2,560th cell is updated, Excel
pops up a window saying that I've exceeded "2,560 cells or rows".

Joe Czapski
Boston, Mass.
 
Can you post your code?

No, sorry. It's in Labview graphical language, all wires and icons, in a
layered hierarchy.

Joe Czapski
Boston, Mass.
 
Hi Joe,

Joseph said:
No, sorry. It's in Labview graphical language, all wires and icons,
in a layered hierarchy.

FWIW, I tested the following code in both XL 2002 & 2003, and I had no
problems. Maybe there's something else you're doing that's causing the
failure at 2560?

Sub test()
Dim xl As Object
Dim wb As Object
Dim l As Long

Set xl = CreateObject("Excel.Application")
Set wb = xl.workbooks.Open("c:\test.xls")

With wb.activesheet
For l = 1 To 10000
.Cells(l, 1).Value = l
Next l
End With

wb.Close True
Set wb = Nothing
xl.Quit
Set xl = Nothing
End Sub

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]
 
Then maybe it's Labview that is the problem??


No, sorry. It's in Labview graphical language, all wires and icons, in a
layered hierarchy.

Joe Czapski
Boston, Mass.
 
Jake Marx said:
FWIW, I tested the following code in both XL 2002 & 2003, and I had no
problems. Maybe there's something else you're doing that's causing the
failure at 2560?

Sub test()
Dim xl As Object
Dim wb As Object
Dim l As Long

Set xl = CreateObject("Excel.Application")
Set wb = xl.workbooks.Open("c:\test.xls")

With wb.activesheet
For l = 1 To 10000
.Cells(l, 1).Value = l
Next l
End With

wb.Close True
Set wb = Nothing
xl.Quit
Set xl = Nothing
End Sub

Thank you very much for testing that! That's a relief that that worked. I
wonder if it's a limit on calling the Show method. I'm going to do some
more troubleshooting.

Joe Czapski
Boston, Mass.
 

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

Back
Top