Xcel file corrupt?

Discussion in 'AutoCAD' started by BillZ, May 3, 2004.

  1. BillZ

    BillZ Guest

    R2005 Vlisp:

    Somtimes when I open Excel with vlisp I can get the excel object and the active workbook and print the file and close excel.
    But some times I get an null object error when I try to get the workbook or sheet.
    WhenI look at the data inside the excel object it looks like this:

    Command: (vlax-dump-object xls_obj t)
    ; _Application: nil
    ; Property values:
    ; ActiveCell (RO) = nil
    ; ActiveChart (RO) = Exception occurred
    ; ActivePrinter = "\\\\FS02\\HP5M(Engineering) on Ne04:"
    ; ActiveSheet (RO) = nil
    ; ActiveWindow (RO) = nil
    ; ActiveWorkbook (RO) = nil

    Does this mean the excel file is corrupt? It prints fine when manually printed from excel.

    TIA

    Bill
     
    BillZ, May 3, 2004
    #1
  2. BillZ

    Jürg Menzi Guest

    Bill

    Did you cleanup excel objects on close? Sample:

    (defun VxExcelInterfaceClose (Sav / ClsFlg)
    (if (and Gb:Wbk (not (vlax-object-released-p Gb:Wbk)))
    (progn
    (vlax-invoke-method Gb:Wbk 'Close Sav)
    (vlax-release-object Gb:Wbk)
    (setq ClsFlg T
    Gb:Wbk nil
    )
    )
    )
    (if (and Gb:ExO (not (vlax-object-released-p Gb:ExO)))
    (progn
    (vlax-invoke-method Gb:ExO 'Quit)
    (vlax-release-object Gb:ExO)
    (setq ClsFlg T
    Gb:ExO nil
    )
    )
    )
    (if ClsFlg (gc))
    (princ)
    )

    Cheers
     
    Jürg Menzi, May 3, 2004
    #2
  3. BillZ

    ECCAD Guest

    Workbook Locked ?
     
    ECCAD, May 3, 2004
    #3
  4. BillZ

    BillZ Guest

    No,
    But I rebooted the machine and now all is well.

    Thanks

    Bill
     
    BillZ, May 3, 2004
    #4
  5. BillZ

    Joe Burke Guest

    Bill,

    As I understand it, restarting the machine resets any busy files to not busy. But
    that doesn't say much about your original question, does it?

    Joe Burke
     
    Joe Burke, May 3, 2004
    #5
  6. BillZ

    BillZ Guest

    Did you cleanup excel objects on close? <<

    That could've been the problem, I tried something that didn't work right (may have been my fault) and closed the Excel file manually without releasing anything.

    Thanks

    Bill
     
    BillZ, May 4, 2004
    #6
  7. BillZ

    Jürg Menzi Guest

    Bill

    Glad to help you...:cool:

    Cheers
     
    Jürg Menzi, May 4, 2004
    #7
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.