Quote:
Originally Posted by mpalazzo
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
-
Function GetVersion() As String
-
GetVersion = SysCmd(acSysCmdAccessVer)
-
End Function
-
Something like the following for the SELECT CASE statement ...
-
Dim version As String
-
-
version = GetVersion
-
-
SELECT CASE version
-
-
Case "10.0"
-
path = "C:\Program Files\Microsoft Office\OFFICE10\Graph.exe."
-
Case ....etc.
-
-
END SELECT
-
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