Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question about arrays in Excel

Status
Not open for further replies.

JoBlink

Technical User
May 28, 2004
38
US
hi!

I have Excel file with several DDE links from external sources, updated @ random intervals. For the example sake let's say there are three links.

I would like to know which of the three links was updated last..

How can I do that?

The links are the part of the array.. Can I identify the link by number? By name? By placing it in a different worksheet or range and returning worksheet with a Range name?

I have a code that triggers an event when any af these links is updated, but I want to isolate down to specific links and make my code tighter.
Any help will be appreciated. Here is a code if you want to see how it was done.

------------------------------------

Dim Links As Variant
' Obtain an array for the links to Excel workbooks
' in the active workbook.

Links = ActiveWorkbook.LinkSources(xlOLELinks)

' If the Links array is not empty, then open each
' linked workbook. If the array is empty, then
' display an error message.

If Not IsEmpty(Links) Then
For i = 1 To UBound(Links)
Workbook.SetLinkOnData Links(i), "myProcedureName"
Next i
Else
MsgBox "This workbook does not contain any links " & _
"to other workbooks"
End If
End Sub


Sub myProcedureName()
'my code goes here
End Sub
 

Hi JoBlink,

I can't tell what it is you want to
accomplish exactly but did you
consider using the strComp function to compare
the links in your array with the links
in your source file?

To tell when the link was last updated, you
can store the date you ran your function in
a variable - or did you mean something else with
"I would like to know which of the three links was updated last" ?

Don't know if this what your wanted, but hope
it's useful.

Peace!
*****TYHAND
 
thank you, you're bringing the points which I have overlooked.

I do not have access to the link source file.
I did not make updates manually, they come automatically at random intervals.

because of all that, all I have is my destination file and DDE formulas, like

=server|subject!parameter,paramater
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top