If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Excel VBA in many versions?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-19-04, 23:55
evolym evolym is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
Question Excel VBA in many versions?

Hi all!
i'm going to write a excel VBA code for some PC with several platform Win 95, Win98, win 2k and on each PC, the installed office are difference. Who knows what version of excel I can choose to write?
If i write on Excel 2K, can it run properly on other version?
If no, could you tell me the solution?
thanks in advanced!
Reply With Quote
  #2 (permalink)  
Old 04-20-04, 09:30
shades shades is offline
Registered User
 
Join Date: Oct 2003
Posts: 1,091
Probably best to plan for it on Excel 97. Excel 5 (predecessor to it) is vastly different, so no sense going there. You might want to check though, to make sure that all versions run the same. Sometimes there can be slight modifications of the Object Library.
__________________
old, slow, and confused
but at least I'm inconsistent!

Rich
(retired Excel 2003 user, 3/28/2008)

How to ask a question on forums
Reply With Quote
  #3 (permalink)  
Old 04-21-04, 13:05
ray705 ray705 is offline
Registered User
 
Join Date: Feb 2003
Location: Wichita,KS
Posts: 44
The Windows OS should not make any difference.
If it is different versions of Excel, the answer really depends on how complex your code will be. I have some Excel 97 macros that work fine on Excel 2000 but one, that I thought was fairly simple, that will not give the same results on an Excel 2000 box.
Reply With Quote
  #4 (permalink)  
Old 04-21-04, 21:36
evolym evolym is offline
Registered User
 
Join Date: Apr 2004
Posts: 2
the aim of VBA code I want to write is one FTP application. I have some PCs with difference Office versions (include Off 95, 97...).
Reply With Quote
  #5 (permalink)  
Old 04-22-04, 09:04
ray705 ray705 is offline
Registered User
 
Join Date: Feb 2003
Location: Wichita,KS
Posts: 44
There are significant differences between Office 95 and 97. Some of the code will work but if you use and API calls, they will not work. You may end up with having to maintain multiple sets of code.
Reply With Quote
  #6 (permalink)  
Old 04-22-04, 14:37
SR22Mike SR22Mike is offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA, Earth
Posts: 65
Quote:
Originally posted by ray705
There are significant differences between Office 95 and 97. Some of the code will work but if you use and API calls, they will not work. You may end up with having to maintain multiple sets of code.
If multiple set's of code are needed, then it might make life a little easier to use a select case on the Version Property and for each case call the appropriate routine.

Select Case Application.Version
Case "Excel 95", "Excel 97" 'or whatever the value returned
Call CodeForExcel9597
Case "Excel 2000"
Call CodeForExcel2000
Case Else
Call CodeForExcel9597 'Assuming lowest level should work for everything
End Select

Again, I don't know what values are returned for any of the versions of Excel, but it shouldn't be hard to figure out. BTW, Version Property is a String.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On