Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Best VBA test for 2007 in Compatibility Mode?

2003/2007

The following works fine except when one is using 2007
in compatibility mode.

Is there a better VBA test than "VBA Application.VERSION = "12.0"
to force MaxRows and MaxColumns to the older limits if one is
in compatibility mode?

If Application.VERSION = "12.0" Then
MaxRows = 1048576 - 1
MaxColumns = 16384 - 1
Else
MaxRows = 65536 - 1
MaxColumns = 256 - 1
End If

TIA
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Best VBA test for 2007 in Compatibility Mode?

I think I'd use something like:

With worksheets(1)
maxrows = .rows.count
maxcolumns = .columns.count
end with

I'm not sure why you're subtracting one, though.

wrote:

2003/2007

The following works fine except when one is using 2007
in compatibility mode.

Is there a better VBA test than "VBA Application.VERSION = "12.0"
to force MaxRows and MaxColumns to the older limits if one is
in compatibility mode?

If Application.VERSION = "12.0" Then
MaxRows = 1048576 - 1
MaxColumns = 16384 - 1
Else
MaxRows = 65536 - 1
MaxColumns = 256 - 1
End If

TIA


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 391
Default Best VBA test for 2007 in Compatibility Mode?

The -1 should have been deleted for this query.

Thanks Dave

Dave Peterson wrote:

I think I'd use something like:

With worksheets(1)
maxrows = .rows.count
maxcolumns = .columns.count
end with

I'm not sure why you're subtracting one, though.

wrote:

2003/2007

The following works fine except when one is using 2007
in compatibility mode.

Is there a better VBA test than "VBA Application.VERSION = "12.0"
to force MaxRows and MaxColumns to the older limits if one is
in compatibility mode?

If Application.VERSION = "12.0" Then
MaxRows = 1048576 - 1
MaxColumns = 16384 - 1
Else
MaxRows = 65536 - 1
MaxColumns = 256 - 1
End If

TIA

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
2003/2007 Compatibility Question Ruthe B Excel Discussion (Misc queries) 5 February 28th 07 04:35 PM
backwards compatibility for Excel 2007 Laura Excel Discussion (Misc queries) 1 February 27th 07 11:50 PM
Excel 2007 and "Compatibility Mode" Chaplain Doug Excel Discussion (Misc queries) 2 February 6th 07 05:45 PM
What does compatibility mode mean sunflowersignsinc Setting up and Configuration of Excel 1 January 11th 07 08:40 PM
compatibility of XL 2007 with openoffice 2.0 Dave F Excel Discussion (Misc queries) 1 December 21st 06 09:58 PM


All times are GMT +1. The time now is 08:12 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"