Execution Error

Execution Error

Anonymous
Not applicable
586 Views
3 Replies
Message 1 of 4

Execution Error

Anonymous
Not applicable
While in the VB Editor, I can run a macro, and it works fine. If I switch over to AutoCAD, and use the -vbarun command to run the exact same macro, I get an "Execution error" on the command line, and the macro does not complete. Any ideas why this "Execution error" only occurs from the Acad command line? I do not have any End statments in this code.


Sample code!!!!
Private Sub CommandButton3_Click()
Dim ObjEnt2 As AcadAttributeReference
Dim VarPick As Variant
Dim VarMatrix As Variant
Dim VarParent As Variant
Me.hide

'it dies on this line

ThisDrawing.Utility.GetSubEntity ObjEnt2, VarPick, VarMatrix, VarParent, "Pick Attribute to replace"

ObjEnt2.TextString = TextBox4.Text
ObjEnt2.Update
Me.Show
End Sub
0 Likes
587 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Not tested, just a thought

Sample code!!!!
Private Sub CommandButton3_Click()
Dim oEntity as AcadEntity
Dim ObjEnt2 As AcadAttributeReference
Dim VarPick As Variant
Dim VarMatrix As Variant
Dim VarParent As Variant
Me.hide

'it dies on this line

ThisDrawing.Utility.GetSubEntity oEntity, VarPick, VarMatrix, VarParent, "Pick Attribute to replace"
If TypeOf oEntity Is AcadAttributeReference
Set ObjEnt2 = oEntity
Else
MsgBox "Wrong object selected: " & oEntity.ObjectName
Exit Sub
End if

ObjEnt2.TextString = TextBox4.Text
ObjEnt2.Update
Me.Show
End Sub

~'J'~
0 Likes
Message 3 of 4

Anonymous
Not applicable
I can see adding that but I am picking the same entity both times so I dont think that its about picking the wrong one

Thanks for your input
0 Likes
Message 4 of 4

Anonymous
Not applicable
I tried this code out of desperation but it gave the same error and didn't give me any code errors just execution error at command prompt after picking attribute.
0 Likes