
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi to all,
I've created a module with Excel's vba were data is copied to drawing in acad.
At home I have a student version of Acad 2014 and it works fine.
When I use the exact copy at work it gives me OLE errors.
Any ideas of how to sort it out?
CODE:
Dim acadApp As AcadApplication
Dim acadDoc As AcadDocument
Dim acadPol As AcadLWPolyline
Dim dblCoordinates() As Double
'Check if AutoCAD is open.
On Error Resume Next
Set acadApp = GetObject(, "AutoCAD.Application")
On Error GoTo 0
'If AutoCAD is not opened create a new instance and make it visible.
If acadApp Is Nothing Then
Set acadApp = New AcadApplication 'PROG STOPS HERE
acadApp.Visible = True
End If
'Check if there is an active drawing.
On Error Resume Next
Set acadDoc = acadApp.ActiveDocument
On Error GoTo 0
'No active drawing found. Create a new one.
If acadDoc Is Nothing Then
Set acadDoc = acadApp.Documents.Add
acadApp.Visible = True
End If
Regards
Kenneth
Solved! Go to Solution.