Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
updating caption of added control
Hello,
i use following code to add a togglebutton to the sheet: Set objOle = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Toggl eButton.1", _ Left:=intLeft, Top:=intTop, Width:=intWidth, Height:=intHeight) With objOle ..Object.Caption = "test" End With The problem is, that the caption doesn't update until, i click the Button. The same problem occurs with CommandButton. Sometimes it works, but in most cases, this error occur. Any ideas? Thanks a lot, Andreas |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
updating caption of added control
try adding
me.repaint after changing the caption -- -- --- ZZ [underground] Semi-musico,cuasi-poeta y loco wrote in message oups.com... Hello, i use following code to add a togglebutton to the sheet: Set objOle = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Toggl eButton.1", _ Left:=intLeft, Top:=intTop, Width:=intWidth, Height:=intHeight) With objOle .Object.Caption = "test" End With The problem is, that the caption doesn't update until, i click the Button. The same problem occurs with CommandButton. Sometimes it works, but in most cases, this error occur. Any ideas? Thanks a lot, Andreas |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
updating caption of added control
This may work on a userform, but Andreas is adding the object to a worksheet.
I was thinking With objOle .Object.Caption = "test" End With Application.screenupdating = false application.screenupdating = true But I don't know if that would work. His code worked fine for me. zz wrote: try adding me.repaint after changing the caption -- -- --- ZZ [underground] Semi-musico,cuasi-poeta y loco wrote in message oups.com... Hello, i use following code to add a togglebutton to the sheet: Set objOle = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Toggl eButton.1", _ Left:=intLeft, Top:=intTop, Width:=intWidth, Height:=intHeight) With objOle .Object.Caption = "test" End With The problem is, that the caption doesn't update until, i click the Button. The same problem occurs with CommandButton. Sometimes it works, but in most cases, this error occur. Any ideas? Thanks a lot, Andreas -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
updating caption of added control
sorry, mea culpa , mea culpa , me sinner, i was working on a userform and
read only on the surface sorry again -- -- --- ZZ [underground] Semi-musico,cuasi-poeta y loco "Dave Peterson" wrote in message ... This may work on a userform, but Andreas is adding the object to a worksheet. I was thinking With objOle .Object.Caption = "test" End With Application.screenupdating = false application.screenupdating = true But I don't know if that would work. His code worked fine for me. zz wrote: try adding me.repaint after changing the caption -- -- --- ZZ [underground] Semi-musico,cuasi-poeta y loco wrote in message oups.com... Hello, i use following code to add a togglebutton to the sheet: Set objOle = ActiveSheet.OLEObjects.Add(ClassType:="Forms.Toggl eButton.1", _ Left:=intLeft, Top:=intTop, Width:=intWidth, Height:=intHeight) With objOle .Object.Caption = "test" End With The problem is, that the caption doesn't update until, i click the Button. The same problem occurs with CommandButton. Sometimes it works, but in most cases, this error occur. Any ideas? Thanks a lot, Andreas -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Updating information in 1 file when it is added to other files | Excel Discussion (Misc queries) | |||
Caption control on shapes | Excel Discussion (Misc queries) | |||
Can a CommandBar Control Caption be Formatted ? | Excel Programming | |||
Toggle change control button face id & caption | Excel Programming | |||
setting the caption in a button control | Excel Programming |