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!
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!
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.
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
Case "Excel 2000"
Call CodeForExcel9597 'Assuming lowest level should work for everything
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.