LinkSources (Excel 97)

J

John Thow

Hi,

Anyone know what's going on here? Excel 97 has the following example of the
use of ActiveWorkbook.LinkSources:-

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 If

I tried this in a workbook with 1 link and it did nothing. On checking in
debug mode, I found aLinks was empty whilst
ActiveWorkbook.LinkSources(xlOLELinks) was 2. Why would aLinks remain empty?

In case it makes any difference, the OS is W2K.
--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.

To e-mail me, replace the DOTs in the Reply-To: address with dots!
 
D

Dave Peterson

Actually, I think you found taht xlOLELinks was a VBA constant with a value of
2.

In xl2002's help (which had the same example as xl97's)--so it might be exactly
the same:

xlOLELinks (also handles DDE links)

and in the preface to the example:
This example displays a list of OLE and DDE links in the active workbook.

Do you have OLE or DDE links in your workbook?

If you just have links to another xls file, try the constant: xlExcelLinks
(which is a constant with a value of 1)
 
J

John Thow

Actually, I think you found taht xlOLELinks was a VBA constant with a value of
2.

In xl2002's help (which had the same example as xl97's)--so it might be exactly
the same:

xlOLELinks (also handles DDE links)

and in the preface to the example:
This example displays a list of OLE and DDE links in the active workbook.

Do you have OLE or DDE links in your workbook?

If you just have links to another xls file, try the constant: xlExcelLinks
(which is a constant with a value of 1)
[Chop]

Thanks Dave.

I just couldn't see what should have been obvious...
[Maybe what was obvious was that I'd been up too late the night before. ;-) ]

--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.

To e-mail me, replace the DOTs in the Reply-To: address with dots!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top