Excel and VB.NET Windows Forms

I have a small application that is supposed to take data out of a running Excel Spreadsheet and perform some basic functions on it, copy it back to a new worksheet, and save it.  My question is, how do I initialize my xlApp object to the already open and running Excel application.  I have examples of creating a new Excel.Application but do not want to do it that way.  The user will already have Excel, the workbook, and worksheet open.  If I can get my xlApp object to equal the running and open Excel then my xlWorkbook and xlWorksheet objects can just equal the active ones of each of these.  Any pointers you can give would be immensely helpful.  Thanks in advance.

Greyeye


Answer this question

Excel and VB.NET Windows Forms

  • hseb

    I may have found my own answer....I think that the GetObject call is what I need along with some other API calls.  Found this in the VS.NET help files under the GetObject (imagine that!) explanation.  If there is an easier way (and it seems like there would be), please let me know.  Going to try the MS suggested way in the morning and will post my results.  Thanks.

    Greyeye

  • Excel and VB.NET Windows Forms