September 27, 2005 at 10:19 am
hzt.
Anyone know of some half decent Resources for ActiveX Scripting help?
Specifically I am looking for help on Formatting .xls files before emailing to personnel.
Any links will be greatly appreciated.
ta ta
September 28, 2005 at 7:38 am
I hope this helps: if you take an html file and change it's extension to .xls, Excel translates the file beautifully, keeping all your table atrributes TR and TD and everything very nicely;
as a result, I usually output my results in formatted html, and then simply change the extension to .xls ;
this works great unless you need to have formulas in your excel document, but for simply presenting data, it beats the crap out of trying to Automated Excel with a CreateObject ("Excel.Application") or anything similar.
Lowell
September 29, 2005 at 8:01 am
What you need to do is search for vbscript examples as that is what activex uses. Also, if you record a macro in excel and then view the code, you will get an idea of the syntax required. Just change it slightly for vbscript equivalent.
To get you started:
Dim xlObj
Set xlObj = WScript.CreateObject("Excel.Application")
xlObj.Visible = TRUE
xlObj.WorkBooks.Add
xlObj.Columns(1).ColumnWidth = 10
xlObj.Cells(1, 1).Value = "Property Name"
xlObj.Range("A1:C1").Select
xlObj.Selection.Font.Bold = True
xlObj.Selection.Interior.ColorIndex = 1
xlObj.Selection.Interior.Pattern = 1 'xlSolid
xlObj.Selection.Font.ColorIndex = 2
Set xlObj = nothing
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply