<?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 Re: I get an error trying to call AutoCAD 2011 from Visual Basic in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937696#M12863</link>
    <description>&lt;P&gt;I haven't written any VBA code in ACAD since version 2006, but if you can give me some more info, I will try to help.&lt;/P&gt;&lt;P&gt;A couple of&amp;nbsp;questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What exactly is the end purpose of the sub you are trying to create?&lt;/P&gt;&lt;P&gt;Are you writing the VBA code to reside within an AutoCAD file using the VBA editor in AutoCAD, with VBA in another application, such as Excel,&amp;nbsp;or as a standalone ap created in VB Studio?&lt;/P&gt;</description>
    <pubDate>Thu, 03 Mar 2011 13:45:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-03-03T13:45:28Z</dc:date>
    <item>
      <title>I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937064#M12862</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I&lt;/SPAN&gt; &lt;SPAN&gt;get&lt;/SPAN&gt; &lt;SPAN&gt;an&lt;/SPAN&gt; &lt;SPAN&gt;error&lt;/SPAN&gt; &lt;SPAN&gt;trying&lt;/SPAN&gt; &lt;SPAN&gt;to&lt;/SPAN&gt; &lt;SPAN&gt;call&lt;/SPAN&gt; &lt;SPAN&gt;AutoCAD&lt;/SPAN&gt; &lt;SPAN&gt;2011&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;Visual&lt;/SPAN&gt; &lt;SPAN&gt;Basic&lt;/SPAN&gt;. &lt;SPAN&gt;I&lt;/SPAN&gt; &lt;SPAN&gt;am&lt;/SPAN&gt; &lt;SPAN&gt;not&lt;/SPAN&gt; &lt;SPAN&gt;an&lt;/SPAN&gt; &lt;SPAN&gt;expert&lt;/SPAN&gt; &lt;SPAN&gt;in&lt;/SPAN&gt; &lt;SPAN&gt;programming&lt;/SPAN&gt; &lt;SPAN&gt;so&lt;/SPAN&gt; &lt;SPAN&gt;im&lt;/SPAN&gt; &lt;SPAN&gt;trying&lt;/SPAN&gt; &lt;SPAN&gt;to&lt;/SPAN&gt; &lt;SPAN&gt;find&lt;/SPAN&gt; &lt;SPAN&gt;out&lt;/SPAN&gt; &lt;SPAN&gt;how&lt;/SPAN&gt; &lt;SPAN&gt;to&lt;/SPAN&gt; &lt;SPAN&gt;call&lt;/SPAN&gt; &lt;SPAN&gt;AutoCAD&lt;/SPAN&gt; &lt;SPAN&gt;2011&lt;/SPAN&gt; &lt;SPAN&gt;from&lt;/SPAN&gt; &lt;SPAN&gt;VB&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;SPAN&gt;Private&lt;/SPAN&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT size="1"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;&lt;SPAN&gt;Sub&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt; &lt;SPAN&gt;Next&lt;/SPAN&gt;_&lt;SPAN&gt;Click&lt;/SPAN&gt;(&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt; sender &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; System.Object, &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt; e &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; System.EventArgs)&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Handles &lt;/FONT&gt;&lt;/FONT&gt;Next.Click&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt; ACAD &lt;FONT color="#0000ff"&gt;&lt;FONT color="#0000ff"&gt;As&lt;/FONT&gt;&lt;/FONT&gt; Autodesk.AutoCAD.Interop.AcadApplication&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="2"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD.ActiveDocument.SaveAs("new")&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD.ActiveDocument.Save()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD.ActiveDocument.Close()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;end sub&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;but everytime i get to the third line, i get an activeX error.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;i am really stuck here because i've tryied everything i know and everything i've found on the internet.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;thank you&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 23:57:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937064#M12862</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-02T23:57:23Z</dc:date>
    </item>
    <item>
      <title>Re: I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937696#M12863</link>
      <description>&lt;P&gt;I haven't written any VBA code in ACAD since version 2006, but if you can give me some more info, I will try to help.&lt;/P&gt;&lt;P&gt;A couple of&amp;nbsp;questions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What exactly is the end purpose of the sub you are trying to create?&lt;/P&gt;&lt;P&gt;Are you writing the VBA code to reside within an AutoCAD file using the VBA editor in AutoCAD, with VBA in another application, such as Excel,&amp;nbsp;or as a standalone ap created in VB Studio?&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 13:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937696#M12863</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-03T13:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937888#M12864</link>
      <description>&lt;P&gt;Visual Basic Customization Forum:&lt;BR /&gt;&lt;A href="http://forums.autodesk.com/t5/Visual-Basic-Customization/bd-p/33" target="_blank" rel="nofollow"&gt;http://forums.autodesk.com/t5/Visual-Basic-Customization/bd-p/33&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2011 15:05:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2937888#M12864</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2011-03-03T15:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2945736#M12865</link>
      <description>&lt;P&gt;I believe you need to "Set" an object to instanciate it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Set ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Mar 2011 17:14:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2945736#M12865</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-03-09T17:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2946446#M12866</link>
      <description>&lt;P&gt;try changing this line:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" color="#000000"&gt;to this:&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18.1")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" color="#a31515"&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" color="#000000"&gt;AutoCAD 2011 is version 18.1 and while the first will work if the machine has never had another version of AutoCAD installed. If it has had another version installed it will fail because now you must grab the correct version.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1" color="#a31515"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Mar 2011 00:04:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2946446#M12866</guid>
      <dc:creator>Mike.Wohletz</dc:creator>
      <dc:date>2011-03-10T00:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: I get an error trying to call AutoCAD 2011 from Visual Basic</title>
      <link>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2978332#M12867</link>
      <description>&lt;P&gt;Yes. I also have the same problem. I had cheanged&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#a31515" size="1"&gt;to&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size="1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ACAD = CreateObject(&lt;FONT size="1"&gt;&lt;FONT color="#a31515"&gt;&lt;FONT color="#a31515"&gt;"autocad.Application.18.1")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#a31515" size="1"&gt;But it still can not work when the first run. At the second time, it mybe sometime&amp;nbsp;OK and sometime failed&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#a31515" size="1"&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Apr 2011 13:56:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/i-get-an-error-trying-to-call-autocad-2011-from-visual-basic/m-p/2978332#M12867</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-04-05T13:56:02Z</dc:date>
    </item>
  </channel>
</rss>

