Office 2003 interop problems, interface, method not found.
- by Snake
This problem is making me crazy.
Actually I have multiple problems.
First one:
Why on earth are is there a _Worksheet and a Worksheetinterface in the Excel interop. They both look the same, except for some attributes on the methods.
It's confusing!
Second of all: my job today is making a VB.NET file more strict, by settings Option Strict On and Option Explicit On
While it works for most files, I'm bumping into a problem.
Here's a little code piece:
Private _pivotTable As Excel.PivotTable
With _pivotTable
pvf = .AddDataField(pvc)
End With
PivotTable.AddDataField is defined on the MSDN page: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.pivottable.adddatafield(office.11).aspx
When I check my local Interop dll w/ Reflector that method is NOT there.
When I run the application, and step through it, the method just works.
When I try to step INTO the method, I get an LateBound Exception.
WTF?
So the question is: why are the interfaces defined more than once (twice sometimes?).
2nd question. AddDataField trouble