The code below navigates to a specified location, opens the folder and allows the user to select an Excel file, which will be opened and the file name stored in the variable "File_nam".
I am trying to do something similar but need help getting it working. I would like to give the user the opportunity to navigate to a location of his choice, and select an Access file. I do not want to open the file, but I need to record the name, which will subsequently be used in reading data from the file using ActiveX Data Objects without opening the file.
I know there is an commend called "GetSelectedFile", but cannot get it to work. How do I get the name of a selected file without opening it? Your help will be greatly appreciated.
Thanks,
George,
Fort Worth
Code:
'
****** Get Data from Checked out Laptop
data_path = "d:\data\CAM_Tool"
''''''**** commented out to use access
If Application.Dialogs(xlDialogOpen).Show(data_path) Then
' continue running subroutine
Else
Exit Sub
End If
File_nam = ActiveWorkbook.Name ' File Name with Raw Data
I am trying to do something similar but need help getting it working. I would like to give the user the opportunity to navigate to a location of his choice, and select an Access file. I do not want to open the file, but I need to record the name, which will subsequently be used in reading data from the file using ActiveX Data Objects without opening the file.
I know there is an commend called "GetSelectedFile", but cannot get it to work. How do I get the name of a selected file without opening it? Your help will be greatly appreciated.
Thanks,
George,
Fort Worth