+ Reply to Thread
Results 1 to 5 of 5

compile time directive - Excel version?

  1. #1
    Registered User
    Join Date
    09-29-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    compile time directive - Excel version?

    I would like to expand some of my macro functions so they work under multiple versions of Excel. With most languages I would use compile time directives. Visual Basic has these options but there are very few constants defined. If I do not use compile time directives then the code will not compile (certain functions can not be resolved). I only care about 2007 and 2010 versions (I use #vba defines for the older versions).

    Is there a way of determining Excel's version number for use in compile time directives?

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: compile time directive - Excel version?

    Please Login or Register  to view this content.
    for 2010.
    You can also simply put 2010 specific code into a separate module and use a check on Application.Version - you won't be able to compile the project, but it will work at runtime.
    Remember what the dormouse said
    Feed your head

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: compile time directive - Excel version?

    Not sure if it helps with your problem but
    Please Login or Register  to view this content.
    Will return the version of excel you are currently using

  4. #4
    Registered User
    Join Date
    09-29-2010
    Location
    Oregon
    MS-Off Ver
    Excel 2003
    Posts
    5

    Re: compile time directive - Excel version?

    Thanks romper, that fixed it...

  5. #5
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: compile time directive - Excel version?

    Glad to help.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1