Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Acess Export to excel - font colour

Posted on 2011-03-02
7
Medium Priority
?
449 Views
Last Modified: 2016-05-15
All

A silly question but i need to try and get an answer.

I have a query in Access 2007 that is emailed to recipients in .xls.  However, the exported excel workbook displays light grey font - not black.  

I realise it is easy to change this in the file but ...... recipents want the font to be black.....

any thoughts appreciated
0
Comment
Question by:shaz0503
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
7 Comments
 
LVL 15

Assisted Solution

by:Simon Ball
Simon Ball earned 2000 total points
ID: 35025555
Use access object to create some automation

dim xlapp as object
Set xlapp = createobject etc...

record a macro to do select all and set font to black....

get xlapp to open the saved file,
then do a with xlapp and paste in the macro...

can provide code if required.
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 35025579
http://support.microsoft.com/kb/247412

Dim oExcel As Object
   Dim oBook As Object
   Dim oSheet As Object

   'Start a new workbook in Excel
   Set oExcel = CreateObject("Excel.Application")
   Set oBook = oExcel.Workbooks.Add


   'Add data to cells of the first worksheet in the new workbook
   Set oSheet = oBook.Worksheets(1)
   oSheet.Range("A1").Value = "Last Name"
   oSheet.Range("B1").Value = "First Name"
   oSheet.Range("A1:B1").Font.Bold = True
   oSheet.Range("A2").Value = "Doe"
   oSheet.Range("B2").Value = "John"

   'Save the Workbook and Quit Excel
   oBook.SaveAs "C:\Book1.xls"
   oExcel.Quit
0
 
LVL 15

Accepted Solution

by:
Simon Ball earned 2000 total points
ID: 35025598
so here is a marco to open a file, change font and colour of the used range...

    Workbooks.Open Filename:= _
        "C:\Documents and Settings\sball\My Documents\Book1font.xls"
    ActiveWorkbook.UsedRange.Select
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 0
        .ThemeFont = xlThemeFontNone
    End With
   
        With Selection.Font
        .ColorIndex = xlAutomatic
        .TintAndShade = 0
    End With
    With Selection.Font
        .ThemeColor = xlThemeColorLight1
        .TintAndShade = 4.99893185216834E-02
    End With

   
    ActiveWorkbook.Save
End Sub
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:Simon Ball
ID: 35025606
then you can put the excel change code inside the automation to make changes to the spreadsheet
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 35025650
0
 

Author Comment

by:shaz0503
ID: 35185414
Apologies for no action on this one - have been busy with other 'stuff'.  Hope to get to this next week.....

rgds

S
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question