Todd Bardoni
Well-known Member
- Joined
- Aug 29, 2002
- Messages
- 3,042
The following code "works", but when Access opens and tries to swith to the specified file I get a message from Access that says something about it does not recognize the commandline. Any ideas?
Code:
Sub AccessDatabase_Execute()
Dim taskID As Double, myPath As String, myFile As String
On Error GoTo errorhandler
myPath = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
myFile = ThisWorkbook.path & "\AMOS Item Master.mdb"
taskID = Shell(myPath + " " + myFile, vbNormalFocus)
Exit Sub
errorhandler:
MsgBox "Cannot find the exe file to open this program.", vbCritical
End Sub