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: 27,285
Default SetLinkOnData help?

aLinks = ActiveWorkbook.LinkSources(xlOLELinks)
If Not IsEmpty(aLinks) Then
For i = 1 To UBound(aLinks)
MsgBox "Link " & i & ":" & Chr(13) & aLinks(i)
Next i
End Ifwill give you a list of the links. expression.SetLinkOnData(Name,
Procedure)Name Required String. The name of the DDE/OLE link, as returned
from the LinkSources method.so assignment can be made at the level of
resolution returned by the top code snippet. If this is to gross, in you
macroDim rng as RangelngNum as Longset rng = Application.CallerlngNum =
Right(rng.formula,1)orif not intersect(rng,Range("A1,C9,D12,F2")) is nothing
then ' calling cell is one of A1, C9, D12, or F2so even if the link is too
gross, you can test immediately if you code should do something, and if not,
then exit the sub.Regards,Tom Ogilvy"Ross" wrote in
message om...
Hi there,

Again, based on very helpful people in this group, I think that
setlinksondata will be useful for me, but I'd appreciate some advice
on how to implement it.

In particular, I have a lot of data coming in by DDE, with different
types of data in different columns, i.e. maybe a number, a time, and a
character. Each column has the same formula for the DDE call with the
exception of one number which determines which data the DDE is
bringing in. for example, one column has formulas that look like:
=DataSource|Whatever!'[H1]Apples.n;3' The 3 represents that it give
me the price of apples. another column will have the same link except
the 3 will be a 4 which will give me the quantity of apples. The next
row would be the same except it would be oranges instead of apples.

Now, I want a macro to run only when certain of the information
changes, i.e. when the price of apples or oranges changes, but not
when the quantity changes. (The macro would check the new price of
apples and see if it has reached my target price and if it has it
would record the time that it reached the price in another cell on the
same row.) Also, this DDE data changes a lot, so I want to make sure
that by running macros I don't miss data.

The worksheet_change function is not triggered by changes in DDE data.
I am afraid that if this function is triggered by EVERY piece of DDE
data, I might bog down the computer with running the macro to check
whether it was the right data that changed.

I suppose what I need is something that activates my worksheet_change
macro (which does the time logging I described above when triggered)
only when the right data has changed.

Any advice would be much appreciated!

Thanks in advance, and again!
Ross



 
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



All times are GMT +1. The time now is 09:21 AM.

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"