Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default A program running on different Excel Versions

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A program running on different Excel Versions

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default A program running on different Excel Versions


thank you Tom

Problem Solved


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default A program running on different Excel Versions


"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
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
how do i disable "running virus scan" in excel program when opened Tammy New Users to Excel 1 June 10th 05 08:48 PM
Using same VBA program in diff. Excel versions. John[_93_] Excel Programming 1 August 2nd 04 02:17 AM
Stop a VB program from running Soterro Excel Programming 4 December 5th 03 07:25 PM
Running Program on a Mac ibeetb Excel Programming 0 October 16th 03 01:47 PM
VB code needed for running newer excel version macros in older excel versions Tom Excel Programming 6 October 16th 03 03:11 AM


All times are GMT +1. The time now is 02:04 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"