May 24, 2007 #1 steve728 Programmer Mar 16, 2003 536 US How do I change the following to instead be exported to Excel with VBA? I'm using WinXP, Office 2003. DoCmd.OpenReport "ISR Problems" Steve728
How do I change the following to instead be exported to Excel with VBA? I'm using WinXP, Office 2003. DoCmd.OpenReport "ISR Problems" Steve728
May 24, 2007 1 #2 lameid Programmer Jan 31, 2001 4,208 US I didn't find anything looking for it exactly except that there is a statement that will export... docmd.RunCommand acCmdExport The catch is that the object had better be active that you want to export. So better to open it immediately before. DoCmd.OpenReport "ISR Problems" docmd.RunCommand acCmdExport The caveat here is that it will only prompt to save and select the file type. On the otherhand you can export a query or table using docmd.transferspreadsheet. Upvote 0 Downvote
I didn't find anything looking for it exactly except that there is a statement that will export... docmd.RunCommand acCmdExport The catch is that the object had better be active that you want to export. So better to open it immediately before. DoCmd.OpenReport "ISR Problems" docmd.RunCommand acCmdExport The caveat here is that it will only prompt to save and select the file type. On the otherhand you can export a query or table using docmd.transferspreadsheet.
May 24, 2007 Thread starter #3 steve728 Programmer Mar 16, 2003 536 US Thanks! You get a star. Am I close to creating code to export a Access table to Excel with: DoCmd.TransferDatabase acExport, "Microsoft Access", "ISR.mdb",acTable, "tblISRProblems" Within the on-line help, I couldn't find what agrument to use specifying Excel.??? Steve728 Upvote 0 Downvote
Thanks! You get a star. Am I close to creating code to export a Access table to Excel with: DoCmd.TransferDatabase acExport, "Microsoft Access", "ISR.mdb",acTable, "tblISRProblems" Within the on-line help, I couldn't find what agrument to use specifying Excel.??? Steve728
May 24, 2007 #4 lameid Programmer Jan 31, 2001 4,208 US Transerspreadsheet not Transferdatabase... The below is close, just fix "FilenameAndPath.xls". docmd.TransferSpreadsheet acExport,acSpreadsheetTypeExcel9,"tblISRProblems","FilenameAndPath.xls",True Upvote 0 Downvote
Transerspreadsheet not Transferdatabase... The below is close, just fix "FilenameAndPath.xls". docmd.TransferSpreadsheet acExport,acSpreadsheetTypeExcel9,"tblISRProblems","FilenameAndPath.xls",True