Hi all,
Although being a novice at VB(A), I really enjoy using it (most of the time)!
At the moment I'm developing an Autocad application for a customer. For various reasons (ease of use, anti-piracy) I would eventually like to convert the VBA macro to an executable. To that effect I mailed the customer a small test program, compiled with VB6, which essentially consisted of the following:
Public AcadObj As AcadApplication
Set AcadObj = CreateObject("AutoCAD.Application")
AcadObj.Visible = True
It worked fine on my system. However, after mailing it to the customer, he reported back the following error message:
Run-time error '429' ActiveX component can't create object
So I mailed him the next version of the test program, its code derived from Joe Sutphin's Autocad 2006 VBA book:
Public AcadObj As AcadApplication
Set AcadObj = CreateObject(Class:="AutoCAD.Application")
AcadObj.Visible = True
Now the customer reported another error message:
Run-time error '13' Type mismatch
He also mentioned that there were multiple versions of Autocad on his system: R14, 2006LT and 2006 full version. Don't ask why. So I looked here and elsewhere for a solution and found the following:
Public AcadObj As AcadApplication
Set AcadObj = CreateObject("AutoCAD.Application.16.2")
AcadObj.Visible = True
The "16.2" addition should make sure to launch Autocad 2006 full version. However, this attempt put us right back in square 1:
Run-time error '429' ActiveX component can't create object
Meanwhile, in order to verify that the code should work on other systems, I rigged up an ancient PC of mine (PII 300MHz, 128MB memory) with a clean install of XP Home and Autocad 2006 full version. All three versions of my test program launched Autocad flawlessly!
Any ideas why my customer's test-runs keep returning errors, anyone?