Need help on exporting data from a query containing my monthly revenue to the revenue range of cells in an existing excel spreadsheet, for example.
Been experimenting for 3 weeks with no luck. So, once again, I'm asking for the expert help that I always get here. It's obvious that I don't know how to do it, regardless of all the 'Google' helps I've read & tried. (I know "poor baby".)
After learning how to do that, I'll use it and add the code to export data from other queries (material, dump, labor, taxes, etc.) to their specific named category ranges in the spreadsheet, by using the appropriate queries and matching category names & range names.
BTW, I've been working on this accounting DB for 2 years. Now, finishing it with the creation of the 'Profit & Loss' report in excel.:banghead:
So, here ya go: using MS Office 12 w/Access 2007 & Excel Ver.12.0.6732
Query name is: "PnLqryJob_Revenue_ByMthName"
xlsx file path is: "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx"
Excel file name is: "Jan-15PnL.xlsx"
Tried these & many more variations:
DoCmd.OutputTo acOutputQuery, "PnLqryJob_Revenue_ByMthName", "ExcelWorkbook(*.xlsx)", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", True, "Revenue", 0, acExportQualityPrint
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PnLqryJob_Revenue_ByMthName", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", -1, "Revenue"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "sqYourQueryNameOrTable", "x:\ExcelFile.xls", -1, "NameRangeInExcelWorkBook"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PnLqryJob_Revenue_ByMthName", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", True, "Revenue", 0, acExportQualityPrint
Been experimenting for 3 weeks with no luck. So, once again, I'm asking for the expert help that I always get here. It's obvious that I don't know how to do it, regardless of all the 'Google' helps I've read & tried. (I know "poor baby".)
After learning how to do that, I'll use it and add the code to export data from other queries (material, dump, labor, taxes, etc.) to their specific named category ranges in the spreadsheet, by using the appropriate queries and matching category names & range names.
BTW, I've been working on this accounting DB for 2 years. Now, finishing it with the creation of the 'Profit & Loss' report in excel.:banghead:
So, here ya go: using MS Office 12 w/Access 2007 & Excel Ver.12.0.6732
Query name is: "PnLqryJob_Revenue_ByMthName"
xlsx file path is: "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx"
Excel file name is: "Jan-15PnL.xlsx"
Tried these & many more variations:
DoCmd.OutputTo acOutputQuery, "PnLqryJob_Revenue_ByMthName", "ExcelWorkbook(*.xlsx)", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", True, "Revenue", 0, acExportQualityPrint
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PnLqryJob_Revenue_ByMthName", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", -1, "Revenue"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "sqYourQueryNameOrTable", "x:\ExcelFile.xls", -1, "NameRangeInExcelWorkBook"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12Xml, "PnLqryJob_Revenue_ByMthName", "C:\9_R11_TY-15\Marketing\Jan-15PnL\Jan-15PnL.xlsx", True, "Revenue", 0, acExportQualityPrint