Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Font of exported excel file 2

Status
Not open for further replies.

SeeJane

Technical User
Joined
Jun 5, 2002
Messages
67
Location
US
Hi all,

I'm hoping someone knows how to resolve an aggravation that's been dogging me for a while.

Is there a way to set the font for an excel spreadsheet exported from Access? I have set the default font for both Access and Excel to Tahoma (10 pt), which works just fine for creating anything new in either application. However, whenever I export a table from Access to Excel, the font of the new workbook is always Microsoft's default (Ariel, I think). Aaaahhh!

Thanks so much,
CJ
 
maybe i'm wrong but I think the only option is to open the spreadsheet after creation and set the font.
but the good news is, you can do it in code:

' remember to create a reference to the
' "Microsoft Excel 8.0 Object Library"
'
Dim ea As Excel.Application
DoCmd.Hourglass True
Set ea = New Excel.Application
Workbooks.Open FileName:="C:\sheet.xls"
Cells.Select
ea.Selection.Font.Name = "Tahoma"
ea.Selection.Font.Size = 10
ea.ActiveWorkbook.Save
ea.ActiveWindow.Close
ea.Quit
Set ea = Nothing
DoCmd.Hourglass False
 
Thanks a ton. It works beautifully!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top