ok, now it's highlighting the Sub Import() in yellow and DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel12Xml, "strTable", "strFilePath", TrueSub Import() in gray
thanks again for helping me
Code:Option Compare Database Sub Import() Dim strTable As String Dim strFilePath As String With Application.FileDialog(msoFileDialogFilePicker) .AllowMultiSelect = False .Title = "Locate a Excel file to Import" .ButtonName = "Market Data" .Filters.Clear .Filters.Add "Excel", "*.xlsx" .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" DoCmd.TransferSpreadsheet , acSpreadsheetTypeExcel12Xml, "strTable", "strFilePath", TrueSub Import() End Sub End Sub