Yeah, I don't know how to specify the spreadsheet though in code. I found this
http://stackoverflow.com/questions/7...cess-using-vba
I tried adapting my VBA myself, but I'm getting an error.
Code:
Sub Import()Dim strTable As String
Dim strFilePath As String
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = False
.Title = "Locate a Excel file to Import"
.ButtonName = "Import"
.Filters.Clear
' .Filters.Add "Excel", "*.xlsx"
.Filters.Add "Excel", "*.xls"
.InitialFileName = "C:\Test"
.InitialView = msoFileDialogViewThumbnail
If .Show = 0 Then
'There is a problem
Exit Sub
End If
'Save the first file selected
strFilePath = Trim(.SelectedItems(1))
End With
strTable = "tbl1_PartPricingDataAggregation"
'strTable = "tblTest"
'DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel12, strTable, strFilePath, False, "A1:L1000"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, strTable, strFilePath& '.tbl1a_Upload_Market_Data!', True,
'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "tbl1_PartPricingDataAggregation", "C:\Test\TestExport.xlsx", False
End Sub