ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Changing Control Object Name( command buttons etc ) from VBA code (https://www.excelbanter.com/excel-programming/401894-changing-control-object-name-command-buttons-etc-vba-code.html)

tony

Changing Control Object Name( command buttons etc ) from VBA code
 
When I use the following code the object name gets changed, but generates an
error message.

Sub testit()
ActiveSheet.OLEObjects("CommandButton1").Name = "newname"
End Sub

ERROR MESSAGE:

MICROSOFT VISUAL BASIC
" Can't enter break mode at this time"

Any





Nigel[_2_]

Changing Control Object Name( command buttons etc ) from VBA code
 
ActiveSheet.CommandButton1.Name = "newname"

--

Regards,
Nigel




"TONY" wrote in message
...
When I use the following code the object name gets changed, but generates
an
error message.

Sub testit()
ActiveSheet.OLEObjects("CommandButton1").Name = "newname"
End Sub

ERROR MESSAGE:

MICROSOFT VISUAL BASIC
" Can't enter break mode at this time"

Any







All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com