Disable 2003 VB code for users using older Excel

P

pgarcia

k, I don't remmeber who it was, but I saw VB code that was used incase your
were run a older vision of Excell other than 2003 or 2002. Any ideas? I
belive it alow the VB code to work in older Excel spread sheet.
thanks
 
G

Gord Dibben

Check out VBA help on Application.Version to disable code for users with older
Excel


If Application.Version <> "10.0" Or Application.Version <> "11.0" Then
MsgBox "This utility will not work in your version of Excel, vbExclamation
End
End If


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Typo.......missed a double-quote after Excel

MsgBox "This utility will not work in your version of Excel", vbExclamation


Gord
 
D

Doug Glancy

You can use the check that Gord mentions and then branch to code that only
newer versions support. For example, if they are running 2000 or newer you
can branch to code that opens a form modelessly, otherwise your code will
not branch and just run it modally. Since VBA is interpreted, Excel 97
never branches to the modeless subroutine and you don't get a compile or
runtime error.

Sorry I don't have time to show an example but I hope that helps.

Doug
 
R

Ron de Bruin

To avoid problems use in non US systems use

If Val(Application.Version) <> 10

In Dutch it is 10,0 instead if 10.0 for example
 

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