TheSwamp
Code Red => VB(A) => Topic started by: robplatt on April 05, 2007, 07:18:47 AM
-
Hi all,
Í've successfully sent stuff from ACAD to Excel and Access, and now i'm trying to do the reverse - ie. access ACAD from Excel using VBA.
I have cobbled together a routine that seems to work, but it needs the line:
Set acadApp = GetObject(, "AutoCAD.Application.16")
I understand all of this except the reference to "16". I gather this is a version reference (I'm using 2006), but where can I find what number to use for other versions?
Your comments greatfully received as always!
-
Registry.
-
If you don't bother with the version, it will find the current application loaded regardless of version.
i.e.
Set acadApp = GetObject(, "AutoCAD.Application")
-
If you want to bother with versions some stations have multiple Acad versions installed, you need to use diffrent code for diffrent versions etc.... this might help you out, it's written for several apps.
-
Thanks Dnereb,
I think I'll probably need something like this.
-
As Keith mentioned, if you need to be version specific, just type in the version as shown below
Set ACADApp = GetObject(, "AutoCAD.Application.16.2")
Mark
-
Hey Rob,
Going back to your original question, if you need the specific version of ACAD that you are using, you can use a very simple macro like
Sub Version()
MsgBox Application.Version
End Sub
The message box will return the version for you
Mark