Message 1 of 3
Com Object and AutoCAD Electrical

Not applicable
10-15-2007
01:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
Does anyone knows how a "vertical" can be loaded.
It's no problem to launch "Vanilla" Acad, but I also need the Eelctrical functionality.
The problem is that none of the AutoCAD Electrical functionality is loaded.
It gives the following message in the prompt.
AutoCAD Electrical menu utilities ; error: no function definition:
WD_ARX_FORMAT_PATH
This is occuring when I use the following code in Excel:
Option Explicit
Private Sub OpenAutoCAD(AutoCAD As AcadApplication)
On Error Resume Next
'attempt to open running AutoCAD
Set AutoCAD = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
'AutoCAD not running, attempt to start
Set AutoCAD = CreateObject("AutoCAD.Application")
If Err Then
'AutoCAD cannot be started, exit
MsgBox "Error, AutoCAD cannot be executed", vbCritical, "Error loading AutoCAD"
On Error GoTo 0
Exit Sub
End If
End If
'make running AutoCAD visible
AutoCAD.Visible = True
End Sub
Public Sub Main()
Dim oAcad As AcadApplication
'open AutoCAD first
OpenAutoCAD oAcad
'then create my stuff
End Sub
If I start AutoCAD Electrical with the icon it works ok, but as soon if I automate it goes wrong. Although it looks the correct profile is loaded.
Does anyone has an idea to get it running?
Does anyone knows how a "vertical" can be loaded.
It's no problem to launch "Vanilla" Acad, but I also need the Eelctrical functionality.
The problem is that none of the AutoCAD Electrical functionality is loaded.
It gives the following message in the prompt.
AutoCAD Electrical menu utilities ; error: no function definition:
WD_ARX_FORMAT_PATH
This is occuring when I use the following code in Excel:
Option Explicit
Private Sub OpenAutoCAD(AutoCAD As AcadApplication)
On Error Resume Next
'attempt to open running AutoCAD
Set AutoCAD = GetObject(, "AutoCAD.Application")
If Err Then
Err.Clear
'AutoCAD not running, attempt to start
Set AutoCAD = CreateObject("AutoCAD.Application")
If Err Then
'AutoCAD cannot be started, exit
MsgBox "Error, AutoCAD cannot be executed", vbCritical, "Error loading AutoCAD"
On Error GoTo 0
Exit Sub
End If
End If
'make running AutoCAD visible
AutoCAD.Visible = True
End Sub
Public Sub Main()
Dim oAcad As AcadApplication
'open AutoCAD first
OpenAutoCAD oAcad
'then create my stuff
End Sub
If I start AutoCAD Electrical with the icon it works ok, but as soon if I automate it goes wrong. Although it looks the correct profile is loaded.
Does anyone has an idea to get it running?