excel

Discussion in 'AutoCAD' started by jackie, Feb 17, 2004.

  1. jackie

    jackie Guest

    hi, all
    how could i know excel is running/open from within acad?
    thx
     
    jackie, Feb 17, 2004
    #1
  2. jackie

    SpeedCAD Guest

    Hi...

    To that you refires with within acad?
     
    SpeedCAD, Feb 17, 2004
    #2
  3. jackie

    Norman Yuan Guest

    you can use error trapping:

    Private Sub SomeProc()

    Dim objExcel As Excel.Application 'Or As Object

    On Error Resume Next
    Set objExcel=GetObject(,"Excel.Application)
    If Err.Number<>0 Then
    MsgBox "Cannot find running instance of Excel Application.",
    vbInformation
    Exit Sub
    End If

    'Do something, say, examine whether a particular workbook is opened.

    End Sub
     
    Norman Yuan, Feb 17, 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.