Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2004
    Posts
    2

    Question Unanswered: 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!

  2. #2
    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

  3. #3
    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.

  4. #4
    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...).

  5. #5
    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.

  6. #6
    Join Date
    Mar 2004
    Location
    Minnesota, USA, Earth
    Posts
    65
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •