LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default OLE Object on Sheet updates Value in Code but not its Display

This is pretty simple, but puzzling. I placed a Label control on a
worksheet. I read in a range of text values that I want to display as
the Label caption after a brief delay. The delay time is read in
seconds. The For Each loop is supposed to update the caption.
However, the caption value does indeed update because I tested it by
putting it out in a MsgBox. But the caption graphic does not update.
Code below. Any ideas appreciated.

Thanks,

SteveM

Sub PlayAff()

Dim affRng As Range
Dim affCell As Range
Dim startTime As Variant
Dim delayTime As Integer
Dim ws As Worksheet

Range("AffAnchor").Select
Range(Selection, Selection.End(xlDown)).Select

Set affRng = Selection
delayTime = Range("DelayTime")
Set ws = Sheets("Play")
ws.Activate
ws.OLEObjects("AffLabel").Object.Caption = ""

For Each affCell In affRng
startTime = Timer
ws.OLEObjects("AffLabel").Object.Caption = affCell
MsgBox ws.OLEObjects("AffLabel").Object.Caption ' Shows
correct text value
Do While Timer <= startTime + delayTime ' caption display
not updated.
Loop
Next

End Sub
 
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
Code into MS Object Sheet Hangs up donbowyer Excel Programming 8 December 30th 07 10:50 PM
Automatic Sheet Updates colemanj4 Excel Programming 4 May 31st 07 11:30 PM
Function Updates from another sheet Floyd[_2_] Excel Programming 0 February 25th 05 04:00 PM
VBA code that will be fired when another user updates links mawjcullen Excel Programming 1 October 28th 04 01:38 PM
Code to not display delete sheet alerts John[_46_] Excel Programming 2 August 25th 03 01:44 PM


All times are GMT +1. The time now is 02:26 PM.

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

About Us

"It's about Microsoft Excel"