Visual Editor is frozen when I run a macro

Visual Editor is frozen when I run a macro

Anonymous
Not applicable
1,398 Views
7 Replies
Message 1 of 8

Visual Editor is frozen when I run a macro

Anonymous
Not applicable

I recorded a macro called: TEST6 (this macro deletes some texts), so I run the macro the texts were removed but the Visual Basic Editor is frozen and I have to use the task manager to close it. Do you know why that happens?

 

Private Sub CommandButton1_Click()

   ThisDrawing.SendCommand "TEST6 "
   ThisDrawing.Close
   UserForm1.Hide
   End

End Sub
0 Likes
1,399 Views
7 Replies
Replies (7)
Message 2 of 8

vince.krueger
Advocate
Advocate

Sounds like your macro is caught in a loop.  Can you share the macro code?

Message 3 of 8

Anonymous
Not applicable

Hello,

 

Thanks for answering, I have an UserForm1 (you can see it below) in the Accept button I have following code:

Private Sub CommandButton1_Click()

   ThisDrawing.SendCommand "TEST6 "
   ThisDrawing.Close
   UserForm1.Hide
   End

End Sub

 

Module code:

Sub Cleanup()
UserForm1.show
End Sub

 

UserForm1.PNG

I don't know if there is an issue with the drawing I'm trying removing texts.

0 Likes
Message 4 of 8

vince.krueger
Advocate
Advocate

Sorry, I should have been more clear.  

 

Can you show the code for TEST6?  I suspect it is not returning properly.

Message 5 of 8

Anonymous
Not applicable

Hello,

 

I attached you the drawing which I want to erase the upper texts and the recorded macro.

 

Thank you!

0 Likes
Message 6 of 8

vince.krueger
Advocate
Advocate

I will not be able to help on this one.  I am running 2019 and it appears you are running a newer version (the macro itself does not behave as expected for me).

0 Likes
Message 7 of 8

lena.talkhina
Alumni
Alumni

Welcome to the Autodesk Community @Anonymous  !

Great to see you here on Visual Basic Customization Forum.

Did you find a solution?
If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information.
If not please don't hesitate to give an update here in your topic so all members know what ́s the progression on your question is and what might be helpful to achieve what you ́re looking for. 🙂

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

0 Likes
Message 8 of 8

vince.krueger
Advocate
Advocate

You may want to move your post over to the .Net forum (from the looks of it you are running with the VB editor inside AutoCAD right?)

0 Likes