I have an Access query and/or table that I'm exporting into an Excel spreadsheet using the TransferSpreads heet action in VBA:
DoCmd.TransferS preadsheet acExport, acSpreadsheetTy peExcel97, "QueryName" , "C:\ExportedFil e.xls"
Using this particular code will export my data to a worksheet named "QueryName" , but is there any way to export the query/table to Excel but to a tab with a different name - without renaming the query/table? For example, if in my database, I have the table "TableX", how can I export this to an Excel file, where the data from TableX is on a worksheet named "Worksheet2010" ?
I hope this was clear, and appreciate any and all help.
Thanks!
DoCmd.TransferS preadsheet acExport, acSpreadsheetTy peExcel97, "QueryName" , "C:\ExportedFil e.xls"
Using this particular code will export my data to a worksheet named "QueryName" , but is there any way to export the query/table to Excel but to a tab with a different name - without renaming the query/table? For example, if in my database, I have the table "TableX", how can I export this to an Excel file, where the data from TableX is on a worksheet named "Worksheet2010" ?
I hope this was clear, and appreciate any and all help.
Thanks!
Comment