CAD software discussion forum > CAD > Troubles import data from ZWCAD12+ to Excel by VBA macro

Troubles import data from ZWCAD12+ to Excel by VBA macro

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 1 of 3

 Troubles import data from ZWCAD12+ to Excel by VBA macro
11-06-2013 03:49 . pm | View his/her posts only
Dear All! I can import vertex coordinates polyline from ZWCAD 12+ to Excel , and My routine in VBA not running . This code running from Excel:
Dim objApp As ZcadApplication
Dim objDoc As ZcadDocument
Dim objEnt As ZcadEntity



Set objApp = GetObject(, "ZWCAD+.Application.2012")
Set objDoc = objApp.ActiveDocument
AppActivate objApp.Caption
objDoc.WindowState = zcMax
On Error Resume Next
objDoc.Utility.GetEntity objEnt, varPnt, "Select object"
memo = objEnt.Color
objEnt.Highlight True
objEnt.Color = acRed
objEnt.Update

end code
Error appears in line: objDoc.Utility.GetEntity objEnt, varPnt, "Select object"
err.description: Method 'Utility' of object 'IZcadDocument' failed
My by any resolves this problem

Rank: 5Rank: 5

Jenny

posts: 479

Registered: 2013-5-6

Message 2 of 3

24-06-2013 12:16 . pm | View his/her posts only
Reply 1# westabra3914


it is a problem of ZWCAD+, pls try this as temporary solution:
modify "Dim objDoc As ZcadDocument" to "Dim objDoc As Object".

This problem will be fixed in the new version soon.

Rank: 1

westabra3914

Newbie

posts: 7

Registered: 2013-6-6

Message 3 of 3

27-06-2013 01:33 . pm | View his/her posts only
Reply 1# westabra3914
Spasibo ! Yours advise is okey
See also