Quick question. Is there a way to define the font you want to use when
outputting a query to Excel, either thru code or macro?
Yes, I use VBA for that kind of stuff. Although I haven't done fonts
specifically.
Modules: Transferring Records to Excel with Automation
http://www.mvps.org/access/modules/mdl0035.htm
To start with I'd use Excel as a reference which helps in using
Intellisense in VBA. Then once it's all working I switch to late
binding.
Late binding means you can safely remove the reference and only have
an error when the app executes lines of code in question. Rather than
erroring out while starting up the app and not allowing the users in
the app at all. Or when hitting a mid, left or trim function call.
This also is very useful when you don't know version of the external
application will reside on the target system. Or if your organization
is in the middle of moving from one version to another.
For more information including additional text and some detailed links
see the "Late Binding in Microsoft Access" page at
http://www.granite.ab.ca/access/latebinding.htm
Finally I like to do the Auto Formatting myself.
Set objSht = objWkb.Worksheets(conSheetName)
With objSht
.....
' Autofit the cells
.range(.Cells(CurrentHeadingRow + 1, 1), .Cells(rsRecordCount
+ CurrentHeadingRow + 1, _
iCountOfCols)).Columns.AutoFit
Tony
--
Tony Toews, Microsoft Access MVP
Tony's Main MS Access pages -
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog -
http://msmvps.com/blogs/access/
For a convenient utility to keep your users FEs and other files
updated see
http://www.autofeupdater.com/