e.barelds@beenen.nl
Guest
|
Posted:
Wed Mar 16, 2005 7:14 pm Post subject:
Accessing AutoCAD documents with Excel |
|
|
Hi,
Is there someone who can tell me what i do wrong;
I'm trying te acces AutoCAD with the following script;
----------------------------------------------
Public objAcadApp As Object
Public objAcadDoc As Object
Public objMSpace As Object
Function IS_ACAD_RUNNING()
On Error Resume Next
Set objAcadApp = GetObject(, "AutoCAD.Application")
If Err Then
MsgBox ("Cant load AutoCAD!" & Chr(13) & Chr(13) & Err.Description)
Err.Clear
End 'Stop the program!
Else
Set objAcadDoc = objAcadApp.ActiveDocument
Set objMSpace = objAcadDoc.ModelSpace
End If
End Function
------------------------------------------------
It does work on one computer, but not on the otherones. The message with I
get is the object is not known?
Grtz, Eddy
|
|
Mike Tuersley
Guest
|
Posted:
Thu Mar 17, 2005 9:03 am Post subject:
Re: Accessing AutoCAD documents with Excel |
|
|
Well you code assumes AutoCAD is running, what if it isn't? So assuming
AutoCAD is installed on all the computers, the If Err should be
If Err.Number <> 0 Then
Err.Clear
Set objAcadApp = CreateObject("AutoCAD.Application.{version}")
where {version} is the number of the release you are trying to access --->
R16.0 =2004, R16.1 = 2005, etc.
-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon... |
|