ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing for different versions of Office (https://www.excelbanter.com/excel-programming/434482-testing-different-versions-office.html)

Oldjay

Testing for different versions of Office
 
I have the following macro that opens an access database. I have some people
that are using Access 2000. Is there any way I can test to see what version
they are using and open that Access version?


Private Sub CommandButton5_Click() 'Add new substrate

Dim X As String

X = Shell("C:\Program Files\Microsoft Office\Office11\MSACCESS.EXE
\\SERVER3\database\SUBSTRATES.MDB", 1)

oldjay

End Sub

OssieMac

Testing for different versions of Office
 
Following appears to work satisfactorily with Access 2002 and Access 2007.
You will need to test with other versions.

Sub TestAccessVersion()


'9 = Access 2000
'10 = Access 2002/XP
'11 = Access 2003
'12 = Access 2007

Dim objAccess As Object

Set objAccess = CreateObject("Access.Application")

MsgBox objAccess.Version

objAccess.Quit

Set objAccess = Nothing

End Sub

--
Regards,

OssieMac




All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com