I have the following piece of code attached to a button on a form. It works great if you only have one sheet in an excel workbook to import. However, the particular workbook I am trying to import from has 2 sheets and I need to import both of them. The sheet names will change from time to time so I can't reference a particular sheet name and have it work every time I import this information.
newFileCMS = curDirCMS 'initializes variable to current directory
newFileCMS = ahtCommonFileOpenSave(aht_OFN_HIDEREADONLY, curDirCMS, strFilter, 1, xls)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblImportSheet", newFileCMS, False
I appreciate any help.
Cindy
newFileCMS = curDirCMS 'initializes variable to current directory
newFileCMS = ahtCommonFileOpenSave(aht_OFN_HIDEREADONLY, curDirCMS, strFilter, 1, xls)
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "tblImportSheet", newFileCMS, False
I appreciate any help.
Cindy