DSX-API-Excel

Discussion in 'AutoCAD' started by Ibro Vehabovic, Nov 30, 2004.

  1. I use DSX-API-Excel.LSP (Visual LISP ActiveX API for Excel 97, 2000 and XP
    Copyright (C)2002 David M. Stein, All rights reserved). The following test
    code

    (load "dsx-api-excel.lsp")
    (DSX-Load-TypeLib-Excel)
    (setq xlapp (DSX-Open-Excel-New "SHOW"))
    (setq range (msxl-Get-ActiveCell xlapp))
    (setq txt '("ITEM1" "ITEM2" "ITEM3" "ITEM4"))
    (DSX-Excel-Put-RowList txt 1 1)

    gives this error: Automation Error. Description was not provided.

    I upgraded to XP - it worked fine on 2000. Anyone experienced
    similar problem?

    Thanks,

    Ibro V.
     
    Ibro Vehabovic, Nov 30, 2004
    #1
  2. Try:

    (defun DSX-Excel-Put-RowList (lst startrow startcol)
    (princ "\n(DSX-Excel-Put-RowList)")
    (foreach itm lst
    (msxl-put-value2 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<
    (DSX-Excel-Get-Cell range startrow startcol)
    itm
    )
    (setq startcol (1+ startcol))
    )
    )

    ; This is my version:
    ; MsX_PutValue2ListOnRow
    ; Description: Write each list member to row (SttRow) starting at column
    (SttCol)
    ; Args: list, SttRow, SttCol
    ; Example: (MsX_PutValue2ListOnRow '("A" "B" "C") 2 1) puts members
    ; into cells (1,B) (1,C) (1,D) respectively
    ;
    ; Fill the excel sheet at the absolute position with the ImpLst argument
    ; horizontally. On nil leave the old value, on "" clear it.
    ;
    (defun MsX_PutValue2ListOnRow (ImpLst RowNum SttCol / CelObj)
    (foreach ForElm ImpLst
    (cond
    ( (null ForElm) )
    ( (= ForElm "")
    (msxm-Clear (setq CelObj (MSX_GetSheetCell RowNum SttCol)))
    (vlax-release-object CelObj)
    )
    ( T
    (msxp-put-Value2 (setq CelObj (MSX_GetSheetCell RowNum SttCol))
    ForElm)
    (vlax-release-object CelObj)
    )
    )
    (setq SttCol (1+ SttCol))
    )
    )

    ; see:
    ; MsXUtl01.LSP - Visual LISP ActiveX API for Excel 97, 2000, XP or >=2003


    --

    Marc'Antonio Alessi
    http://xoomer.virgilio.it/alessi
    (strcat "NOT a " (substr (ver) 8 4) " guru.")

    --
     
    Marc'Antonio Alessi, Nov 30, 2004
    #2
  3. Marc,
    I works - thanks a lot!!!

    Ibro V.
     
    Ibro Vehabovic, Dec 1, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.