Excel OLE Automation example with C#

Im not 100% sure what you are trying to do here... but if you are looking to provide web services while Automating Excel on the back end, there are a lot of issues... I would have a read here: INFO: Considerations for Server-Side Automation of Office.

That said, using OLE Automation through the COM Interop is doable for Excel 2003. Its tougher for Excel 2002, but with the PIAs installed it tends to be ok. For Excel 2000 and below, late binding is pretty much required...

I wrote a tutorial on the subject using VB.Net
Automating Office Programs with VB.Net / COM Interop, but I think it should be very easy to convert to C#.

Personally, Ive just ordered C#.Net, so maybe Ill re-write it one of these days. :)
 
Well, my C# just arrived today... Who-hoo! :)

But I would not count on a re-write any-time soon. Theres not a lot of code in that tutorial anyway, so it really wouldnt change much. Only DirectCast(), really, would have to go and all the discussion related to it.

I would probably compensate for that "loss" by discussing the passing of Arrays to Excel and back, for this is an important key to execution speed efficiency. (You can see Here to see what I mean.)

So Ill let you know if I update it, but Im pretty swamped for the next few weeks...
 
Back
Top