By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

Add reference to Graph.exe for different versions of ms office

P: 1
I'm doing some graph manipulation in VBA, and have made a reference (and am using successfully) the Graph.exe for MS Office. My problem is that I can't be sure exactly what version of Access my end users will be using--or more precisely where their Graph.exe lives. So for some, the reference will point to C:\Program Files\Microsoft Office\OFFICE11\Graph.exe and for others it might be C:\Program Files\Microsoft Office\OFFICE10\Graph.exe. Also what if they didn't install Office to its default location? I'm compiling and releasing an .mde file, but aren't sure how to get around this problem. Thanks in advance, Mike.
Sep 11 '07 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
I'm doing some graph manipulation in VBA, and have made a reference (and am using successfully) the Graph.exe for MS Office. My problem is that I can't be sure exactly what version of Access my end users will be using--or more precisely where their Graph.exe lives. So for some, the reference will point to C:\Program Files\Microsoft Office\OFFICE11\Graph.exe and for others it might be C:\Program Files\Microsoft Office\OFFICE10\Graph.exe. Also what if they didn't install Office to its default location? I'm compiling and releasing an .mde file, but aren't sure how to get around this problem. Thanks in advance, Mike.
Hi Mike

You can use this function triggered in a suitable location to determine the version of Access being used. Then use a SELECT CASE statement to determine the path to the Graph.exe

Expand|Select|Wrap|Line Numbers
  1. Function GetVersion() As String
  2.      GetVersion = SysCmd(acSysCmdAccessVer)
  3.  End Function
  4.  
Something like the following for the SELECT CASE statement ...

Expand|Select|Wrap|Line Numbers
  1. Dim version As String
  2.  
  3.     version = GetVersion
  4.  
  5.     SELECT CASE version
  6.  
  7.     Case "10.0"
  8.         path = "C:\Program Files\Microsoft Office\OFFICE10\Graph.exe."
  9.     Case ....etc.
  10.  
  11.     END SELECT
  12.  
These are the versions:

8.0 = Access 97
9.0 = Access 2000
10.0 = Access 2002(XP)
11.0= Access 2003
12.0= Access 2007
Sep 12 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.