I'd like to export two tables in Access into one Excel workbook as two separate sheets.<br>Is it possible to do this? <br>I have VBA in Excel that is running VBA in Access, so I can either export or import on either end, which ever is easiest.
open the table you want to export click on file,export select to excel, match your version ,locate the workbook you want to export to, it will create a new sheet when you click OK That simple
I'm sorry that I wasn't more specific in my post, but I'd like to do this using VBA without user input, and create the new sheets in the currently open workbook.<br>I haven't been able to do this yet and I think it is because the Excel file is currently open so Access can't write to the file. <br>But I was hoping that there might be a way around this problem.<br>
To do it in VBA use<br>DoCmd.TransferSpreadsheet [transfertype][,spreadsheettype], tablename, filename[, hasfieldnames][, range]<br>something like this <br><br>DoCmd.TransferSpreadsheet acExport, , "Your Table", "c:\my documents\Yoursheet.xls"<br><br>but this errors if sheet is open so probably not much help<br>You need someone smarter then me. Should be easy to find<br><br>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.