Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Cells(my_crt_row,my_crt_col+1) crashes for my_crt_row65536

I tried this in Excel 2007, where the worksheets may have 1M rows.
Why does this crash?
In Excel 2000 to 2003, this thing worked fine for my_crr_row<=65536, as I
expected. But now, having more rows in a sheet, why does this not work for a
larger row number?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 293
Default Cells(my_crt_row,my_crt_col+1) crashes for my_crt_row65536

Hi Bede,

If you're running in 97/2003 compatibility mode (as you must if the wb is in xls format), you're still limited to 65536 rows and 256
columns per sheet.

--
Cheers
macropod
[Microsoft MVP - Word]


"BEDE" wrote in message ...
I tried this in Excel 2007, where the worksheets may have 1M rows.
Why does this crash?
In Excel 2000 to 2003, this thing worked fine for my_crr_row<=65536, as I
expected. But now, having more rows in a sheet, why does this not work for a
larger row number?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Cells(my_crt_row,my_crt_col+1) crashes for my_crt_row65536

I'd add something like this

Dim aWS as Excel.Worksheet
Dim myLastRow as long
Set aWS = ActiveSheet

myLastRow = aWS.Rows.Count

Replace 65536 with myLastRow and it should work.

This way you're covered if you use it in 2003 or 2007. FWIW, you probably
have the workbook opened in 2007, but it's in a compatible version.
--
HTH,

Barb Reinhardt



"BEDE" wrote:

I tried this in Excel 2007, where the worksheets may have 1M rows.
Why does this crash?
In Excel 2000 to 2003, this thing worked fine for my_crr_row<=65536, as I
expected. But now, having more rows in a sheet, why does this not work for a
larger row number?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Cells(my_crt_row,my_crt_col+1) crashes for my_crt_row65536

Also, if you've dimensioned my_crr_row as an integer, it won't work for Excel
2007. You need to change it to Long. The upper limit of integer is less
than the # of rows in Excel 2007 native worksheets. Unfortunately, I can't
find the documentation for it.
--
HTH,

Barb Reinhardt



"BEDE" wrote:

I tried this in Excel 2007, where the worksheets may have 1M rows.
Why does this crash?
In Excel 2000 to 2003, this thing worked fine for my_crr_row<=65536, as I
expected. But now, having more rows in a sheet, why does this not work for a
larger row number?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Cells(my_crt_row,my_crt_col+1) crashes for my_crt_row65536

Found it

Integer - integer handles the range of numbers -32,768 to 32,767.
Long - Long handles the number range -2,147,483,648 to 2,147,483,657.

I never ran into Integer/Long issues until I moved to 2007, but I imagine I
might have in 2003 under some situations.
--
HTH,

Barb Reinhardt



"BEDE" wrote:

I tried this in Excel 2007, where the worksheets may have 1M rows.
Why does this crash?
In Excel 2000 to 2003, this thing worked fine for my_crr_row<=65536, as I
expected. But now, having more rows in a sheet, why does this not work for a
larger row number?

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 2007 crashes on entering data in a specific range of cells Sunny Dacat Excel Discussion (Misc queries) 1 September 12th 08 01:16 PM
Visible automated Excel: automation crashes if user selects cells, protection? Christian Friedrich Excel Programming 1 November 3rd 06 04:26 AM
Excel crashes as soon as I try to format cells? Mike Excel Discussion (Misc queries) 0 May 19th 06 06:17 PM
Excel warning "too many different types of cells", then crashes.. Agotro Excel Programming 2 February 17th 06 06:05 AM
Copy row, Insert>Copied>Cells crashes Excel Kent Excel Discussion (Misc queries) 0 April 26th 05 10:48 PM


All times are GMT +1. The time now is 01:16 PM.

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

About Us

"It's about Microsoft Excel"