Best VBA test for 2007 in Compatibility Mode?

E

EagleOne

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
 
D

Dave Peterson

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.
 

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

Top