A
Ali Tahbaz
I'm having trouble iterating through LinkSources in an Excel workbook
using C#. I first wrote the below code in VBA to get a quick, correct
result,
Dim x As Variant
For Each x In ThisWorkbook.LinkSources
Debug.Print x
Next
but am so far unable to successfully convert the code to workable
C# syntax. C#'s compiler complains
"foreach statement cannot operate on variables of type 'object'
because 'object' does not contain a definition for 'GetEnumerator', or
it is inaccessible"
when I try to use the below code :
foreach(string Src in wb.LinkSources(rfl.Missing.Value)) {
Console.WriteLine(Src);
}
What can I do to list the links in a workbook from C#?
Thanks in advance,
Ali Tahbaz, MCSD
using C#. I first wrote the below code in VBA to get a quick, correct
result,
Dim x As Variant
For Each x In ThisWorkbook.LinkSources
Debug.Print x
Next
but am so far unable to successfully convert the code to workable
C# syntax. C#'s compiler complains
"foreach statement cannot operate on variables of type 'object'
because 'object' does not contain a definition for 'GetEnumerator', or
it is inaccessible"
when I try to use the below code :
foreach(string Src in wb.LinkSources(rfl.Missing.Value)) {
Console.WriteLine(Src);
}
What can I do to list the links in a workbook from C#?
Thanks in advance,
Ali Tahbaz, MCSD