<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Check if autoCAD is open in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6419926#M8772</link>
    <description>&lt;P&gt;Hello there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I writhe a VBA to check if autoCAD Application is open, and when YES then call a Sub and when NO make a message box that autoCAD is close.&lt;/P&gt;&lt;P&gt;Below have you a VBA that I whant to integrate in Excel.&lt;/P&gt;&lt;PRE&gt;Sub runsub(control As IRibbonControl)&lt;BR /&gt;&lt;BR /&gt;Dim acadApp As AcadApplication&lt;BR /&gt;Dim acadDoc As AcadDocument&lt;BR /&gt;&lt;BR /&gt;If acadApp Is Nothing Then&lt;BR /&gt;MsgBox "AutoCAD is closed"&lt;BR /&gt;Else&lt;BR /&gt;Call Zeichnung&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;P&gt;Can you please help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Jul 2016 17:11:41 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-07-05T17:11:41Z</dc:date>
    <item>
      <title>Check if autoCAD is open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6419926#M8772</link>
      <description>&lt;P&gt;Hello there!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I writhe a VBA to check if autoCAD Application is open, and when YES then call a Sub and when NO make a message box that autoCAD is close.&lt;/P&gt;&lt;P&gt;Below have you a VBA that I whant to integrate in Excel.&lt;/P&gt;&lt;PRE&gt;Sub runsub(control As IRibbonControl)&lt;BR /&gt;&lt;BR /&gt;Dim acadApp As AcadApplication&lt;BR /&gt;Dim acadDoc As AcadDocument&lt;BR /&gt;&lt;BR /&gt;If acadApp Is Nothing Then&lt;BR /&gt;MsgBox "AutoCAD is closed"&lt;BR /&gt;Else&lt;BR /&gt;Call Zeichnung&lt;BR /&gt;End If&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;P&gt;Can you please help me out?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2016 17:11:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6419926#M8772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-05T17:11:41Z</dc:date>
    </item>
    <item>
      <title>Re: Check if autoCAD is open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6420938#M8773</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can use GetObject() to try to get a connection to an running instance of AutoCAD.&lt;/P&gt;
&lt;P&gt;But in case you don't get a positive result that does not mean that AutoCAD was not started, it could also be that AutoCAD is running, just not responding (current active with something).&lt;/P&gt;
&lt;P&gt;Check the list of processes for "acad.exe" could also be a test.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- alfred -&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 08:44:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6420938#M8773</guid>
      <dc:creator>Alfred.NESWADBA</dc:creator>
      <dc:date>2016-07-06T08:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Check if autoCAD is open</title>
      <link>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6421856#M8774</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub sbACAD()
Dim objAutoCAD As Object

On Error Resume Next
Set objAutoCAD = GetObject(, "AutoCAD.Application")
On Error GoTo 0

If objAutoCAD Is Nothing Then
          
MsgBox "AutoCAD is not running", vbOKOnly, "Error"
          
Else: AppActivate "AutoCAD"
objAutoCAD.WindowState = 3

End If
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jul 2016 16:42:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/check-if-autocad-is-open/m-p/6421856#M8774</guid>
      <dc:creator>Jonathan3891</dc:creator>
      <dc:date>2016-07-06T16:42:47Z</dc:date>
    </item>
  </channel>
</rss>

