Hi,
I am using this subroutine.
Sub ImportExcelSpreadsheet()
Dim Sheetname As String
Sheetname = "'Contacts1'"
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, "NewImport", "T:/Copy of Yuba County - Master9.xlsm", True, Sheetname
End Sub
It can't find a specific worksheet "Contacts1". If I eliminate SheetName from the end of the the DoCmd, it works but it only imports the first worksheet in the workbook.
I have tried naming a range and tacking that on to the DoCmd and it does work. But what can I do to make it use the worksheet name.
Thanks