I'm looking for assistance please.
I have a sub routine in Access that opens an instance of Excel. However I can hard code the path to the Excel file and it works fine, but I want to have a file dialog box open up and the user selects the path. Once the code is ran, I want the user to navigate to the location where the Excel file resides.
Here is what I have
Code:
Dim xlApp as Object
Dim sDialog as String
set xlApp = CreateObject("Excel.Application")
'This works, but...
sDialog = "c:\mypath\myfileDir\file.xlsx"
'I want...
sDialog = <user selected path>
with xlApp
xlApp.WorkBooks.Open (sDialog)
xlApp.Visible = true
End With
set xlApp = Nothing
Thanks for any help with this.
Ken