View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Joe[_46_] Joe[_46_] is offline
external usenet poster
 
Posts: 48
Default get Control of a Butoon placed in the Sheet

I have button placed on a sheet from "control toolbox"
I need to change the caption of the button thru code.

I found the following link at ozgrid . com
http://www.ozgrid.com/forum/showthread.php?t=74185

There I saw two approches, but both are failing for me.


I tried to test with following codes. These codes are in a Module.

Sub test1()
Set btn = Worksheets("Selection Sheet").Shapes("Button_Proceed")
MsgBox btn.OLEFormat.Object.Caption
End Sub

Sub test2()
MsgBox Worksheets("Selection
Sheet").Shapes("Button_Proceed").TextFrame.Charact ers.Text
End Sub


Both are returning run time errors..

Run-time Error '438'
Object doesn't support this property or method (Error 438)



can anyone help???

best regards
Joe