View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Christopher Rizzo Christopher Rizzo is offline
external usenet poster
 
Posts: 3
Default Excel 2002 RTD - GetNewValues and RestartServers

Stephen,

The wrapper idea was good - I was using a function wrapper for RTD
anyway. Here's what I did, which gives me most of the functionality I
need:

In the ConnectData method of my real-time data solution, I check a
variable that determines if this is the first pass through this
procedure. If this is true, it checks to see what value the
GetNewValues parameter has being passed into the function. Under this
condition a message box appears, asking users if they want to refresh
data. Since an existing worksheet will always pass GetNewValues =
False when re-opened, this gives the user an opportunity to refresh
existing values or keep the last saved data. If they choose to keep
static data, a global variable sets GetNewValues = False and all data
on the worksheet will remain static (though updates will still happen
behind the scenes). If the user chooses to receive refreshed data,
the global variable is set to True and all data will be constantly
refreshed. A side-note here is this: even on a static worksheet, if
a user wants a new data item's value, they can enter the function and
return a fresh value, but one that will remain static (this is because
all newly entered values will have GetNewValues=True, which will
override the global setting. The other place I made a change is to
check the status of the global GetNewValues variable before performing
an .UpdateNotify. If it's false, I skip the update - if it's true, I
update away.

Next thing for me to do is implement a toggle to turn this on/off at
will. Given my current implementation, this should be pretty easy as
my global variables could probably just become properties to the RTD
component.

Thanks for your help with this - let me know if you want to see some
code.

CJR