VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Right click Run-Time Error

1 REPLY 1
SOLVED
Reply
Message 1 of 2
catalin91ch
417 Views, 1 Reply

Right click Run-Time Error

Hello, I made a macro to pick multiple points, the problem is if I right click in the moment when I have to pick a point it gives me a run-time error and stops at this line:

varPnt = ThisDrawing.Utility.GetPoint(, "Punct de preluat: ")

The macro works if I normaly click (left click), but if I right click by mistake I run into this problem and I would like to prevent this.

1 REPLY 1
Message 2 of 2

Hi,

 

you can set the statement before your GetPoint call:

   On Error Resume Next

and after the line with GetPoint evaluate Err.Number or Err.Description to see what type of error occured.

 

To finish that type of error handling (ignoring the error and resume with the next line) use this line:

   On Error Goto 0

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost