Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I have this code which I am using to rid of the respective macros assigned to 11 different shapes on my worksheet. Each shape is named wthr_btn_# where # is a value between 1 and 11.
The line in red is stopping the code with an error. "Application defined or object defined error".
swbtn = "wthr_btn_1"
wthr_btn_1 has a macro assigned to it: "pkdata_3.xlsm!btn_mclr"
Suggestions to overcome the error?
Rich (BB code):
With ws_gui
For wbtn = 1 To 11
swbtn = "wthr_btn_" & wbtn
With .Shapes(swbtn)
.OnAction = "" 'removes macro assignments
.Fill.ForeColor.RGB = vbWhite
.Line.Weight = 0.25
.Line.ForeColor.RGB = vbBlack
End With
Next wbtn
End With
The line in red is stopping the code with an error. "Application defined or object defined error".
swbtn = "wthr_btn_1"
wthr_btn_1 has a macro assigned to it: "pkdata_3.xlsm!btn_mclr"
Suggestions to overcome the error?