Consulting

Results 1 to 5 of 5

Thread: Solved: detect which version of excel is running

  1. #1
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location

    Solved: detect which version of excel is running

    Is there a way using the workbook open event to tell which version of excel is opening the workbook then display it in a message box?
    Peace of mind is found in some of the strangest places.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    [vba]

    Private Sub Workbook_Open()
    Select Case Val(Application.Version)
    Case 12: MsgBox "Excel 2007"
    Case 11: MsgBox "Excel 2003"
    Case 10: MsgBox "Excel 2002/XP"
    Case 9: MsgBox "Excel 2000"
    End Select
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    Thanks bob. Spot on as usual.
    Peace of mind is found in some of the strangest places.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    There should be a format for version shouldn't there? Something like

    [vba]

    Msgbox Format(Val(Application.Version),xlVersion)
    [/vba]

    <BG>
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Moderator VBAX Master austenr's Avatar
    Joined
    Sep 2004
    Location
    Maine
    Posts
    2,033
    Location
    What I am after is that this workbook could potentially be opened on any machine using excel. Depending on what version opens it (in this case 2003 or 2007) the user will be prompted to use a different version of instructions to install missing addins. This is a project I am doing for a university which is migrating from 2003 to 2007. It can be done on campus or taken home to do. So the message box would say:

    "You are running Excel 2003, please use the instructions that pertain to that version to install the addins." Likewise for 2007.
    Peace of mind is found in some of the strangest places.

Posting Permissions

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