David L. Hansen
asked on
Help with formatting column widths in vba upon export to excel from access.
I've got a query in an access database which I'm using in some vba code. I'm exporting its results to an Excel spreadsheet. All is working well except that the columns are all the same width and rather narrow. How can I cause them to automatically adjust to appropriate widths?
Here is the code:
Here is the code:
DoCmd.OutputTo acOutputQuery, "OptCouncilRpt", acFormatXLS, "C:\Temp\OptCouncilRpt.xls"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<only creates the file, it does not open. >
the code open it, hidden, formatted the column width and saved.
open the excel file and see.
do you want it to stay open?
the code open it, hidden, formatted the column width and saved.
open the excel file and see.
do you want it to stay open?
ASKER
Yes, sorry for forgetting about this. I did want it to open automatically. I found the code I needed too. Thanks a ton.
ASKER