<?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: GetObject &amp; CreateObject not supported in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461546#M39722</link>
    <description>See other post</description>
    <pubDate>Wed, 26 Oct 2005 20:15:29 GMT</pubDate>
    <dc:creator>fxcastil</dc:creator>
    <dc:date>2005-10-26T20:15:29Z</dc:date>
    <item>
      <title>GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461540#M39716</link>
      <description>Windows XP&lt;BR /&gt;
AutoCAD 2002&lt;BR /&gt;
VBA&lt;BR /&gt;
&lt;BR /&gt;
I asked this question on September 14, under a thread titled "GetObject CreateObject not supported."&lt;BR /&gt;
&lt;BR /&gt;
I get an error message when I try to use either of these functions: "Compile error: Object library feature not supported."&lt;BR /&gt;
&lt;BR /&gt;
The word "GetObject" or the word "CreateObject" is highlighted in the VBA IDE.&lt;BR /&gt;
&lt;BR /&gt;
I posted my code on the September 14 thread, although the code was pretty ordinary, and no one found a problem with it that pertains to this problem.&lt;BR /&gt;
&lt;BR /&gt;
Today I tried Joe Sutphin's suggestion.  I uninstalled and re-installed AutoCAD.  The problem persists.&lt;BR /&gt;
&lt;BR /&gt;
Are there any more ideas?</description>
      <pubDate>Mon, 17 Oct 2005 18:48:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461540#M39716</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-17T18:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461541#M39717</link>
      <description>Well I made an error in the previous post.  The portion that is highlighted is not the words I said, but the characters that precede them, that is, the portion that is highlighted is:&lt;BR /&gt;
&lt;BR /&gt;
excelApp = &lt;BR /&gt;
&lt;BR /&gt;
of the line&lt;BR /&gt;
&lt;BR /&gt;
Set excelApp = ... etc.</description>
      <pubDate>Mon, 17 Oct 2005 19:04:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461541#M39717</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-17T19:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461542#M39718</link>
      <description>Well, a couple of items to check.&lt;BR /&gt;
&lt;BR /&gt;
First, is Excel installed? [I know this one should be a gimme]&lt;BR /&gt;
&lt;BR /&gt;
Second, do you have a reference set to Excel [Tools|References]&lt;BR /&gt;
&lt;BR /&gt;
Third, does Excel appear to be working properly?&lt;BR /&gt;
&lt;BR /&gt;
Fourth, you could attempt to instantiate an instance of Excel from something &lt;BR /&gt;
like Word to help narrow it down.&lt;BR /&gt;
&lt;BR /&gt;
Below is a sample of code that I know works for me.&lt;BR /&gt;
&lt;BR /&gt;
Joe&lt;BR /&gt;
--&lt;BR /&gt;
&lt;BR /&gt;
Public ExcelApp As Excel.Application&lt;BR /&gt;
Public Workbook As Excel.Workbook&lt;BR /&gt;
Public WorkSheet As Excel.WorkSheet&lt;BR /&gt;
&lt;BR /&gt;
Public Sub StartExcel()&lt;BR /&gt;
  On Error Resume Next&lt;BR /&gt;
  Set ExcelApp = GetObject(, "Excel.Application")&lt;BR /&gt;
  If Err Then&lt;BR /&gt;
    Err.Clear&lt;BR /&gt;
    Set ExcelApp = CreateObject("Excel.Application")&lt;BR /&gt;
    If Err Then&lt;BR /&gt;
      MsgBox "Cannot start Excel", vbCritical, "Error Starting Excel"&lt;BR /&gt;
      Unload Me&lt;BR /&gt;
    End If&lt;BR /&gt;
  End If&lt;BR /&gt;
  ExcelApp.Visible = True&lt;BR /&gt;
  Set Workbook = ExcelApp.Workbooks.Add&lt;BR /&gt;
  Set WorkSheet = ExcelApp.Worksheets(1)&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;RANDY richardson=""&gt; wrote in message news:4986735@discussion.autodesk.com...&lt;BR /&gt;
Well I made an error in the previous post.  The portion that is highlighted &lt;BR /&gt;
is not the words I said, but the characters that precede them, that is, the &lt;BR /&gt;
portion that is highlighted is:&lt;BR /&gt;
&lt;BR /&gt;
excelApp =&lt;BR /&gt;
&lt;BR /&gt;
of the line&lt;BR /&gt;
&lt;BR /&gt;
Set excelApp = ... etc.&lt;/RANDY&gt;</description>
      <pubDate>Mon, 17 Oct 2005 20:20:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461542#M39718</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-17T20:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461543#M39719</link>
      <description>Well I guess the problem has been solved.  My co-worker changed the following line&lt;BR /&gt;
&lt;BR /&gt;
Dim excelApp As Excel.Application&lt;BR /&gt;
&lt;BR /&gt;
to&lt;BR /&gt;
&lt;BR /&gt;
Dim excelApp&lt;BR /&gt;
&lt;BR /&gt;
He also found it necessary, in other parts of the program that I did not post the code for, to also eliminate the type definitions for Worksheet, Workbook, and Shape.  With those changes, everything's working fine.&lt;BR /&gt;
&lt;BR /&gt;
I don't know how he thought to do that, or why it makes a difference, but I won't argue with success.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for considering my question.&lt;BR /&gt;
&lt;BR /&gt;
Randy Richardson&lt;BR /&gt;
Hattiesburg, MS&lt;BR /&gt;
&lt;BR /&gt;
PS, If anyone would like to satisfy my curiosity, do you have any idea why defining those types might be a problem?&lt;BR /&gt;
&lt;BR /&gt;
RR</description>
      <pubDate>Wed, 26 Oct 2005 18:02:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461543#M39719</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-26T18:02:20Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461544#M39720</link>
      <description>Randy,&lt;BR /&gt;
&lt;BR /&gt;
You did not add a "Reference" to the excel library in your Autocad project. In the VBA editor go to Tool/Reference then&lt;BR /&gt;
look for excel library.  If you want to learn more read about late binding vs. early binding. Early binding is when you tell the VBA editor what libary you will be using before the project compiles. To test this go to the editor and type Ex the hold down the "ctrl" and  "space bar " if you see excel that means you have added the reference to the excel libary (early binding). I would always recommend using early binding this way,you have acess to all the properties and methods of the library as you are writing your program.&lt;BR /&gt;
&lt;BR /&gt;
I use the "ctrl" and  "space bar " to complete typing code this way you have a quick view of properties and methods of objects you are using. Also use the View/Object browser to see the librays you have added to your project and also see what you libray can do.  Sorry you went to some much troble to get your problem solved . But if you use the "ctrl" and  "space bar " to help you type you will get fewer errors.&lt;BR /&gt;
&lt;BR /&gt;
After adding the reference go back to the example Joe or I gave you in the previous posts.&lt;BR /&gt;
&lt;BR /&gt;
Fred C</description>
      <pubDate>Wed, 26 Oct 2005 18:44:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461544#M39720</guid>
      <dc:creator>fxcastil</dc:creator>
      <dc:date>2005-10-26T18:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461545#M39721</link>
      <description>This didn't solve the problem.  While it solved the problem on the machine&lt;BR /&gt;
on which the program had not worked before, the program stopped working on&lt;BR /&gt;
all the machines on which it had previously worked.&lt;BR /&gt;
&lt;BR /&gt;
Looking at Joe's code again, I noticed that he used "Public" where I used&lt;BR /&gt;
"Dim," so I changed my "Dim"s to "Public".  I re-defined the types.  Now it&lt;BR /&gt;
works on everyone's machine.  Thanks to all those who helped and tried to&lt;BR /&gt;
help.&lt;BR /&gt;
&lt;BR /&gt;
-Randy&lt;BR /&gt;
&lt;BR /&gt;
&lt;RANDY richardson=""&gt; wrote in message news:4995407@discussion.autodesk.com...&lt;BR /&gt;
Well I guess the problem has been solved.  My co-worker changed the&lt;BR /&gt;
following line&lt;BR /&gt;
&lt;BR /&gt;
Dim excelApp As Excel.Application&lt;BR /&gt;
&lt;BR /&gt;
to&lt;BR /&gt;
&lt;BR /&gt;
Dim excelApp&lt;BR /&gt;
&lt;BR /&gt;
He also found it necessary, in other parts of the program that I did not&lt;BR /&gt;
post the code for, to also eliminate the type definitions for Worksheet,&lt;BR /&gt;
Workbook, and Shape.  With those changes, everything's working fine.&lt;BR /&gt;
&lt;BR /&gt;
I don't know how he thought to do that, or why it makes a difference, but I&lt;BR /&gt;
won't argue with success.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for considering my question.&lt;BR /&gt;
&lt;BR /&gt;
Randy Richardson&lt;BR /&gt;
Hattiesburg, MS&lt;BR /&gt;
&lt;BR /&gt;
PS, If anyone would like to satisfy my curiosity, do you have any idea why&lt;BR /&gt;
defining those types might be a problem?&lt;BR /&gt;
&lt;BR /&gt;
RR&lt;/RANDY&gt;</description>
      <pubDate>Wed, 26 Oct 2005 19:48:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461545#M39721</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-10-26T19:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: GetObject &amp; CreateObject not supported</title>
      <link>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461546#M39722</link>
      <description>See other post</description>
      <pubDate>Wed, 26 Oct 2005 20:15:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/getobject-createobject-not-supported/m-p/1461546#M39722</guid>
      <dc:creator>fxcastil</dc:creator>
      <dc:date>2005-10-26T20:15:29Z</dc:date>
    </item>
  </channel>
</rss>

