Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a program written on Excel 2003 and when i tried to run it on Excel
97, it would not compile correctly using the visual basic editor. I could not find a command to differentiate between the two versions of EXCEL. I wanted a command such that the appropriate code would be compiled for the machine that i was on #if EXCEL 2003 then .....code #else #if EXCEL 97 ... code #end # end any suggestions? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The usual source of this problem is that you have used features in VBA that
are not supported in xl97. For example, for the sort function, there are additional options introduced in xl2002/3 that xl97 does not recognize. The only solution is to compile the code, have the compiler highlight the area, fix the problem. Repeat until you get a good compile. In the future you should do all your development on the lowest version of excel. If you want to go with compiler directives, you can do #if vba6 then ....code #else ... code # end xl2000 and above used VBA6. xl97 used vba5, but the compiler constants vba6 was only defined in vba6. So if the constant is defined, you are in xl2000 or later, otherwise xl97 or earlier. You still have to write the correct code for each version. Unless there is a special feature you must have when operating in the later version, it is easier to develop in xl97 (or the lowest version that will use the code). If you haven't gotten that far and the problem is a references problem (unknown library), then you need to go into Tools=References and fix the bad references (shown as MISSING). -- Regards, Tom Ogilvy "Ian Stanborough" wrote in message ... I have a program written on Excel 2003 and when i tried to run it on Excel 97, it would not compile correctly using the visual basic editor. I could not find a command to differentiate between the two versions of EXCEL. I wanted a command such that the appropriate code would be compiled for the machine that i was on #if EXCEL 2003 then ....code #else #if EXCEL 97 ... code #end # end any suggestions? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thank you Tom Problem Solved *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Ian Stanborough" wrote in message ... I have a program written on Excel 2003 and when i tried to run it on Excel 97, it would not compile correctly using the visual basic editor. I could not find a command to differentiate between the two versions of EXCEL. I wanted a command such that the appropriate code would be compiled for the machine that i was on #if EXCEL 2003 then ....code #else #if EXCEL 97 ... code #end # end any suggestions? What language do you use? /Fredrik |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i disable "running virus scan" in excel program when opened | New Users to Excel | |||
Using same VBA program in diff. Excel versions. | Excel Programming | |||
Stop a VB program from running | Excel Programming | |||
Running Program on a Mac | Excel Programming | |||
VB code needed for running newer excel version macros in older excel versions | Excel Programming |