Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
I am trying to test for various versions of office.
The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
Hi,
Try this ThisVersion = Application.Version Mike "oldjay" wrote: I am trying to test for various versions of office. The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
I inserted "ThisVersion = Application.Version" as the first line of the Sub.
Same result "Mike H" wrote: Hi, Try this ThisVersion = Application.Version Mike "oldjay" wrote: I am trying to test for various versions of office. The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
Hi,
I don't understand whay you mean by 'Same result' try it in an empty sub with no other code Sub version() MsgBox Application.version End Sub Mike "oldjay" wrote: I inserted "ThisVersion = Application.Version" as the first line of the Sub. Same result "Mike H" wrote: Hi, Try this ThisVersion = Application.Version Mike "oldjay" wrote: I am trying to test for various versions of office. The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
This spreadsheet is used by different people using different versions of
Office. The purpose is to detect which version they are using and open the proper Access database. It works for 2 version of Office but not 3. I am wondering if you can have an On Error Goto ehandler3 under another On Error Goto ehandler2?? "Mike H" wrote: Hi, I don't understand whay you mean by 'Same result' try it in an empty sub with no other code Sub version() MsgBox Application.version End Sub Mike "oldjay" wrote: I inserted "ThisVersion = Application.Version" as the first line of the Sub. Same result "Mike H" wrote: Hi, Try this ThisVersion = Application.Version Mike "oldjay" wrote: I am trying to test for various versions of office. The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Difference office versions
Public gXLver As Long
Sub test() gXLver = Val(Application.Version) ' in startup routine If gXLver = 10 Then ' XL 2002, 2003, 2007 ' (2010 will be 14) Else ' XL 97 Or 2000 End If End Sub Depending on what you are doing you can't necessarily put XL2002+ methods in the same routine or even module. Even if the code doesn't get called in the earlier version a compile error can occur if the object or arguments in a built in function are nor recognized. Regards, Peter T "oldjay" wrote in message ... This spreadsheet is used by different people using different versions of Office. The purpose is to detect which version they are using and open the proper Access database. It works for 2 version of Office but not 3. I am wondering if you can have an On Error Goto ehandler3 under another On Error Goto ehandler2?? "Mike H" wrote: Hi, I don't understand whay you mean by 'Same result' try it in an empty sub with no other code Sub version() MsgBox Application.version End Sub Mike "oldjay" wrote: I inserted "ThisVersion = Application.Version" as the first line of the Sub. Same result "Mike H" wrote: Hi, Try this ThisVersion = Application.Version Mike "oldjay" wrote: I am trying to test for various versions of office. The following doesn't work. Need help Private Sub CommandButton39_Click() 'Add new customer Dim X As String Dim Y As String Dim Z As String On Error GoTo ehandler3 X = Shell("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler3: On Error GoTo ehandler4 Y = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) Exit Sub ehandler4: Z = Shell("C:\Program Files\Microsoft Office\Office12\MSACCESS.EXE \\SERVER3\database\customers.MDB", 1) End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Difference between versions 11.8307.8211 and 11.8169.8172 | Excel Discussion (Misc queries) | |||
Multiple Office Versions | Excel Programming | |||
Is solver different between Office versions? | Excel Worksheet Functions | |||
Vlookup -Difference between 2 versions | Excel Worksheet Functions | |||
difference between office 2003 and office 2007 | Excel Discussion (Misc queries) |