So I am looking for VBA code to allow me to select a file using filedialog
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.Title = "Select the Excel file to import"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Excel Files", "*.xlsx", 1
.Filters.Add "All Files", "*.*", 2
.InitialFileName = "c:\"
If .Show = -1 Then
strFileName = .SelectedItems(1)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "Test", strFileName, True, "B!"
Due to a password being set on this spreadsheet i get run time error "run-time error '3274' external table is not in the expected format"
how can I workaround this issue
Dim dlg As FileDialog
Set dlg = Application.FileDialog(msoFileDialogFilePicker)
With dlg
.Title = "Select the Excel file to import"
.AllowMultiSelect = False
.Filters.Clear
.Filters.Add "Excel Files", "*.xlsx", 1
.Filters.Add "All Files", "*.*", 2
.InitialFileName = "c:\"
If .Show = -1 Then
strFileName = .SelectedItems(1)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12Xml, "Test", strFileName, True, "B!"
Due to a password being set on this spreadsheet i get run time error "run-time error '3274' external table is not in the expected format"
how can I workaround this issue
