This project has moved and is read-only. For the latest updates, please go here.
When referencing COM Automation collections late-bound, the enumeration via For Each does not automatically work. An explicitly cast or set to a variable of type IEnumerable will work, though:

        Dim app As Object = ExcelDnaUtil.Application

        Dim sh As Object
        Dim flg As Boolean

        For Each sh In CType(app.Worksheets, IEnumerable)
            ' Do stuff with sh here

This should not be needed if an interop library is referenced.

Last edited May 27, 2013 at 12:42 PM by govert, version 2