A Worksheet Issue on C# Excel Interop
I'm currently trying to do an all-around and deep researches into the c# excel interop interoperability because it is deliberate and easier to see the differences by using separate start/end cell. On which condition should we choose to use worksheet?
In my briefly conducted example, c# excel
works very fine, but if the practice dictates one or the other, I'd
rather not use it. Instead, I would like to use the demonstration of c#
excel interop. I've never done any c# excel interop before, so I've no
idea what the difference is when it shows that there's also a Worksheet
interface.
In
the c# excel interop, it is very common thing to organize a whole bunch
of event callbacks into interfaces. Therefore, we have two interfaces
on the "incoming" interface. It is the method you are expected to turn
to when urgent events happen. An event is essentially a method that an
object calls when something happens. In c# excel interop, the events are
plain and simple.
Soon
after the type library is translated into metadata automatically, those
relationships are preserved accordingly. It would be much nicer to have
a hand-generated PIA that made the classes and interfaces conform more
to what we'd expect in the managed world. But unfortunately, this didn't
happen. Therefore the Office PIA is full of these seemingly odd
replicas where every creatable object seems to have two interfaces
associated with each other. One of the interfaces represents the
interface to the c# excel interop, and one of them represents the
incoming interface to that c# excel interop.
The
Workbook interface is the proper interface on the workbook co class.
The Workbook interface is the right interface which can represents the
co class itself and therefore inherits from the Workbook. In a word, I
would rather use the convenient c# excel interop.