Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I got it resolved... ThisWorkbook.Worksheets("Selection Sheet").OLEObjects("Button_Proceed").Object.Captio n = ObjNewText thanks anyway joe |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Worksheets("Sheet1").CommandButton1.Caption = "hi there"
'or Worksheets("Sheet1").OLEObjects("Commandbutton1"). Object.Caption = "bye there" (change the sheet name to what you need) Joe wrote: 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Control of Sheet Tab functions? | Excel Programming | |||
Refer to a control name from another sheet | Excel Programming | |||
Control Sheet | Excel Worksheet Functions | |||
For each control in sheet | Excel Programming | |||
Control End After the Sheet is Modified | Excel Discussion (Misc queries) |