Format Excel from Access

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Do you know how to format Excel from Access particularly how to:

merge cells
set fill color
set font color
set text alignment
set font type
set font size
set border

Thank you
GL
 
To do this, you have to use COM (Automation). Using VBA, you can open a
workbook, select the worksheet, select a cell or a range of cells, and do any
manipulation you can do working in Excel. This required your VBA skills be
good and that you understand the Excel Objet Model. A couple of hints to
help along the way:
Here is some good info on opening an excel file:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctcreateobject.asp

You can use the Object Browser in the VBA Editor to help you along
understanding the Excel Object Model

One trick to get going is to open up an Excel sheet, start recording a
Macro, do manually whatever you want your code to do, stop the macro, go into
the macro editor, copy the code it created, and paste it into your Access
code. It will take some minor tweeking, but it is sure a way to start.
 
Back
Top