Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2005

Tip: Looking for answers? Try searching our database.

How can I format the Excel Spreadsheet I export from MS Access us.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Meenu - 31 Mar 2005 13:49 GMT
I want to format specific cells which I exported from MS Access using
TransferSpreadsheet. Assuming I exported an entire table from Access, I now
want to format the first row in the spreadsheet with font color say "red" and
maybe have borders on certain cells etc.

Is this possible?
SusanV - 31 Mar 2005 14:26 GMT
use a template?

>I want to format specific cells which I exported from MS Access using
> TransferSpreadsheet. Assuming I exported an entire table from Access, I
[quoted text clipped - 4 lines]
>
> Is this possible?
John Nurick - 31 Mar 2005 20:46 GMT
Hi Meenu,

You need to use Automation to launch Excel, open the workbook Access has
just created, and adjust the formats. In the VBA editor, to go
Tools|References and set a reference to the Excel object model, then
write code something vaguely like this. strFileSpec should contain the
path to the workbook, and strSheetName should usually contain the name
of the table or query you exported.

 Dim oBook As Excel.Workbook

 Set oBook = GetObject(strFileSpec)

 With oBook.Worksheets(strSheetName)
   .Rows(1).Font.Color = vbBlue
 End With

 oBook.Save
 oBook.Close
 Set oBook = Nothing
 

>I want to format specific cells which I exported from MS Access using
>TransferSpreadsheet. Assuming I exported an entire table from Access, I now
>want to format the first row in the spreadsheet with font color say "red" and
>maybe have borders on certain cells etc.
>
>Is this possible?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.