Hi,
I have a Pivot table query in access 2007 and I want to export it to excel and provide a directory location and file name.
I've tried all of these statements below and the only ones that work are the ones that are not commented and I am not getting the spreadsheet saved as a file on a directory with the file name I want to use:
Any help would be appreciated.
Thanks,
Surfside
I have a Pivot table query in access 2007 and I want to export it to excel and provide a directory location and file name.
I've tried all of these statements below and the only ones that work are the ones that are not commented and I am not getting the spreadsheet saved as a file on a directory with the file name I want to use:
Code:
DoCmd.OpenQuery "qry_Private_Brands_Pivot", acViewPivotTable, acEdit
DoCmd.RunCommand acCmdPivotTableExportToExcel
'DoCmd.RunCommand acCmdPivotTableExportToExcel, report_dir & FileName & timeStamp & ".xlsx", False, ""
'DoCmd.TransferSpreadsheet acCmdPivotTableExportToExcel ', "qry_Private_Brands_Pivot", report_dir & FileName & timeStamp & ".xlsx", False, ""
'DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel10, "qry_Private_Brands_Pivot", report_dir & FileName & timeStamp & ".xlsx", True
DoCmd.Close acQuery, "qry_Private_Brands_Pivot"
Thanks,
Surfside
Comment