Results 1 to 10 of 10

Thread: open acad drawings within excel VBA

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,168
    Location
    Quote Originally Posted by garylee
    The following code works to check if autocad is already running


    Dim AcadApp as AcadApplication
    If AcadApp Is Nothing Then
       Set AcadApp = CreateObject("AutoCAD.Application")
       Else
       Set AcadApp = GetObject(, "AutoCAD.Application")
    End If

    great thanks to Tommy
    garylee,

    All the code you have posted does is check to see if the variable has been inialized. But just to test open acad and step through it, what you will see is the code will execute for "Set AcadApp = CreateObject("AutoCAD.Application")" will execute no matter if acad is already open or not.
    Last edited by Aussiebear; 04-09-2023 at 04:42 AM. Reason: Adjusted the code tags

Posting Permissions

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