UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Set Excel Column Width From Access When Exporting, Office 2003    
 
   
spooker
post 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
Go to the top of the page
 
+
Doug Steele
post 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.
Go to the top of the page
 
+
spooker
post 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 the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th June 2013 - 12:06 AM

Tag cloud: