Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.programming
zz zz is offline
external usenet poster
 
Posts: 14
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating information in 1 file when it is added to other files Kyle Excel Discussion (Misc queries) 1 December 18th 09 03:18 PM
Caption control on shapes RobN[_2_] Excel Discussion (Misc queries) 4 April 12th 08 01:47 AM
Can a CommandBar Control Caption be Formatted ? RAFAAJ2000[_2_] Excel Programming 5 July 10th 05 08:16 AM
Toggle change control button face id & caption mikeburg[_2_] Excel Programming 1 June 25th 05 03:00 AM
setting the caption in a button control Andy Dorph Excel Programming 4 December 15th 04 05:03 PM


All times are GMT +1. The time now is 01:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"