Formatting excel spreadsheet following query export

clay88pc

New member
Local time
Today, 10:02
Joined
May 31, 2013
Messages
3
Hi everyone,

I successfully exported a query from Access to Excel, but now I want to programmatically format the newly created excel spreadsheet. Is there a way to do this from the VBA code in Access?

I just need guidance in getting my objects defined and correctly referenced so I can begin coding as if I were in Excel doing the VBA rather than Access.

This is what I have so far

Function Export()

'Run Query
DoCmd.OpenQuery "Tracker_Generator", acViewNormal, acEdit

'Export Query to Excel
DoCmd.OutputTo acOutputQuery, "Tracker_Generator", "ExcelWorkbook(*.xlsx)", "", True, "", , acExportQualityPrint

End Function

I would great appreciate any help! Thanks :)
 
Thanks for the link SOS. It's helped a lot. :)
 
Hello, I've put this code into my database however it only exports the first 6 records of my query (the query in access displays 40 records). I haven't altered the code at all. Where am I going wrong?
 

Users who are viewing this thread

Back
Top Bottom