Results 1 to 9 of 9

Thread: Working with Excel

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    SW Connecticut/NY area
    Posts
    9,178

    Default Working with Excel

    DF-19, Win-10
    I'm using cmdExcel.pkg and EXCEL12.pkg, both provided here by Matt Davidian. I'm creating and populating a spreadsheet and that part works fine.

    During the population of the spreadsheet I'm doing the following and the line "Set SetBold of hoExcel True" throws the error shown below because phDispatchDriver = 0.

    Code:
        Send InitializeExcel to hoExcel "" 
        Send NewSpreadSheet of hoExcel
        
        Move (SizeOfArray(saResults)) to iMaxRows
        Move (SizeOfArray(saResults[1])) to iMaxCols
        Move 7 to iCounter
        Move 1 to iStartRow
        
        // excel body
        For iRow from iStartRow to iMaxRows
            For iCol from 1 to (iMaxCols - iStartingColumn)
                Set Cell of hoExcel iRow iCol to saResults[(iRow-iStartRow)][(iCol-1 + iStartingColumn)] 
                If (iRow = iStartRow) Send SetBold of hoExcel True  // errors
            Loop
        Loop
    
    
        Send SaveSpreadSheetAs of hoExcel sFilename C_XLSX_FORMAT
        Send DeInitializeExcel to hoExcel
    The line that blows up is here, "Set comProperty..."
    Any ideas as to why phDispatchDriver is 0?
    Code:
        Procedure Set ComBold Boolean value
            Set ComProperty of (phDispatchDriver(Self)) 3 OLE_VT_BOOL to value
        End_Procedure
    Invalid message. SET_COMPROPERTY

    Error: 98

    SET_COMBOLD (9887) - oObject (180) - at address 70877
    MSG_SETBOLD (14239) - oExcelExport (156) - at address 118142
    MSG_EXPORT_TO_EXCEL (15424) - oClientArea (145) - at address 134365
    MSG_EXPORT_TO_EXCEL (15424) - oReportTelemetry (157) - in native code
    Last edited by Bob Worsley; 28-May-2018 at 01:36 PM.
    Bob Worsley
    203-249-2633
    rlworsley at gmail.com

    Do or do not. There is no try. — Yoda

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •