ExcelChampion
Well-known Member
- Joined
- Aug 12, 2005
- Messages
- 976
A problem that is troubling me is the issue of trying to open an Access Database from Excel. I have the following code:
which will work only if the myFile path contains no spaces. If one of the folders contains a space in the name, such as, "My Folder" the macro fails to open Access properly and results in Access giving an error message.
Has anyone got a work-around for this?
Regards.
Code:
myPath = "C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE"
myFile = ThisWorkbook.Path & "\Research_Lookup_Tool.mdb"
taskID = Shell(myPath + " " + myFile, vbNormalFocus)
which will work only if the myFile path contains no spaces. If one of the folders contains a space in the name, such as, "My Folder" the macro fails to open Access properly and results in Access giving an error message.
Has anyone got a work-around for this?
Regards.