Hello again, I've searched and searched and searched but to no avail. I have a dialog box with a button labelled 'pick entity'. When clicked, the dialog is hidden (with Me.hide) and I call the function, then I call Me.show Thisdrawing.Utility.GetEntity obj, var, "Pick entity" where obj is an AutoCAD object and var is a variant I've tried using AcadEntity(s) and AcadPoint(s) and every mixture but it makes no difference. When I call the function there is always an automation error. Is it possible to use VBA dialogs interactively? I can get it working no problem if I call the code without clicking the button. Has anyone come across this problem before. Many thanks if anyone can help me on this. Here is the code I am using: Function entsel() As Object On Error GoTo entsel_error Dim obj As Object Dim pt(0 To 2) As Double ThisDrawing.Utility.GetEntity obj, pt, "Select Block From screen" entsel = obj entsel_error: MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure entsel of Module LayerMod" End Function