Office 2003 interop problems, interface, method not found.

Posted by Snake on Stack Overflow See other posts from Stack Overflow or by Snake
Published on 2010-02-01T13:42:48Z Indexed on 2010/04/26 20:33 UTC
Read the original article Hit count: 353

Filed under:
|
|
|

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

© Stack Overflow or respective owner

Related posts about excel

Related posts about interop