PC Review


Reply
Thread Tools Rate Thread

Disable 2003 VB code for users using older Excel

 
 
=?Utf-8?B?cGdhcmNpYQ==?=
Guest
Posts: n/a
 
      29th Sep 2007
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
 
Reply With Quote
 
 
 
 
Gord Dibben
Guest
Posts: n/a
 
      29th Sep 2007
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

On Fri, 28 Sep 2007 16:50:00 -0700, pgarcia <(E-Mail Removed)>
wrote:

>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


 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      29th Sep 2007
Typo.......missed a double-quote after Excel

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


Gord

On Fri, 28 Sep 2007 17:39:19 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:

>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


 
Reply With Quote
 
Doug Glancy
Guest
Posts: n/a
 
      29th Sep 2007
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

"pgarcia" <(E-Mail Removed)> wrote in message
news:857EB110-D9C5-4804-BE21-(E-Mail Removed)...
> 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


 
Reply With Quote
 
Ron de Bruin
Guest
Posts: n/a
 
      29th Sep 2007
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



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Gord Dibben" <gorddibbATshawDOTca> wrote in message news:(E-Mail Removed)...
> Typo.......missed a double-quote after Excel
>
> MsgBox "This utility will not work in your version of Excel", vbExclamation
>
>
> Gord
>
> On Fri, 28 Sep 2007 17:39:19 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:
>
>>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

>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
using Excel 2003 protected sheets with older versions of Excel =?Utf-8?B?bGlzYWQ=?= Microsoft Excel Misc 0 28th Mar 2007 05:52 PM
Any way to save VBA code so it works with older Excel revisions? =?Utf-8?B?ZnVnYXppNDg=?= Microsoft Excel Programming 2 16th May 2006 01:59 PM
My older excel files will not open in excel 2003, what now? =?Utf-8?B?REc=?= Microsoft Powerpoint 0 21st Sep 2004 03:33 AM
VB code needed for running newer excel version macros in older excel versions Tom Microsoft Excel Programming 6 16th Oct 2003 03:11 AM
Code for runnning macros created in XP in older excel versions Tom Microsoft Excel Programming 1 15th Oct 2003 02:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:30 PM.