Hi, I have an access database and an excel 2003 (.xls) file in the same folder. I want a button on the access database switchboard to open the excel file, but it wants a full file path. Due to certain circumstances this path may be subject to change, and I don't know how to refer to an external excel file within the same folder. Currently I have:
Quote_Builder.xls is the file I'm trying to open, but if I don't put a path in the 'objXLApp.Workbooks.Open' command then it errors out saying it could not be found. Any help?
Code:
Private Sub Command60_Click()
Dim objXLApp As Object
Dim objXLBook As Object
Set objXLApp = CreateObject("Excel.Application")
Set objXLBook = objXLApp.Workbooks.Open("Quote_Builder.xls")
objXLApp.Application.Visible = True
End Sub
Quote_Builder.xls is the file I'm trying to open, but if I don't put a path in the 'objXLApp.Workbooks.Open' command then it errors out saying it could not be found. Any help?