ActiveX Script Resources?

  • 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


    gex

  • 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


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • 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


    ------------------------------
    The Users are always right - when I'm not wrong!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply