Buck Beasom
asked on
Late Binding & Formatting Excel from VBA
Using Access 2003.
I've pulled some code off of this site and also gotten some specific advice on doing things like underlining cells, making the contents bold and so forth. (I think the last guy gave up on me.)
I tried using code pulled from Excel macros, but got errors which I was told came from the fact that I was using "Late Binding" and that - as a result - the Excel reference library was not visible to my Access application. That same person suggested a set of numbers to use instead of things like Weight(xlThin) but the numbers didn't work either.
It seems to me that if I can figure out to do "Early Binding" - or whatever it really is - I can manipulate the Excel sheets I am populating using code cut out of Excel Macros and save myself alot of headaches. Can anyone tell me how to do that - or, alternatively, what the proper syntax for handling basic excel formatting commands like underline, bold, column width and so forth?
Thanks.
I've pulled some code off of this site and also gotten some specific advice on doing things like underlining cells, making the contents bold and so forth. (I think the last guy gave up on me.)
I tried using code pulled from Excel macros, but got errors which I was told came from the fact that I was using "Late Binding" and that - as a result - the Excel reference library was not visible to my Access application. That same person suggested a set of numbers to use instead of things like Weight(xlThin) but the numbers didn't work either.
It seems to me that if I can figure out to do "Early Binding" - or whatever it really is - I can manipulate the Excel sheets I am populating using code cut out of Excel Macros and save myself alot of headaches. Can anyone tell me how to do that - or, alternatively, what the proper syntax for handling basic excel formatting commands like underline, bold, column width and so forth?
Thanks.
macro recorder?
This ain't XL/Word etc(:-)
This ain't XL/Word etc(:-)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Forced accept.
Computer101
EE Admin
Computer101
EE Admin
Sub Macro1()
Selection.Font.Underline = xlUnderlineStyleSingle
Selection.Font.Bold = True
Columns("A:A").ColumnWidth
Rows("1:1").RowHeight = 22.5
End Sub
When you want the VBA for other simple commands, just switch on the macro recorder, make the formatting changes you want, switch off the macro recorder and then look at the VBA.