I'm trying to dynamically import an Excel Spreadsheet into Access. The problem is, i need to import a specific sheet (this part sorted out), but I'm having problems importing a sheet whose name changes month to month.
Code example:
DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, "MonthSales", FileName, 1, "Sales_Month!"
On the "Sales_Month!" is where i need it to be dynamic. I can import it directly if the sheet has always the same name. So my question is, can i import it with some sort of wildcard?
For example: "Sales_*!"
Note: This Excel Workbook has several worksheets.
Worksheetsand check if the current sheet's name isLike "Sales_*!". Something equivalent is presumably doable in Access VBA.DoCmd.TransferSpreadsheet acLink, acSpreadsheetTypeExcel12Xml, "MonthSales", FileName, 1, ActiveSheet.Name