My Assistant
![]() ![]() |
|
|
Jan 29 2012, 05:37 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 132 From: South Staffordshire, UK |
Is there a way to set the width of Excel columns when exporting from Access?
I have VBA code to export the data to excel which works OK, but the excel file does not adjust the column to the size of the text within the fields and I have to manually adjust the columns in excel each time the data is exported. Is there a way to do this using VBA at the time of exporting the data? I'm using Access 2003. Thanks in advance. Terry |
|
|
|
Jan 29 2012, 05:55 PM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,804 From: Don Mills, ON (Canada) |
You'd have to use Automation to instantiate an instance of Excel and format it once you've exported the spreadsheet.
See my July, 2005 Access Answers column in Pinnacle Publication's "Smart Access" (Excelling Automatically) for an example. |
|
|
|
Jan 30 2012, 11:19 AM
Post
#3
|
|
|
UtterAccess Addict Posts: 132 From: South Staffordshire, UK |
Thanks Doug, I'll take a look.
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 20th June 2013 - 12:06 AM |