Link to home
Start Free TrialLog in
Avatar of Alyanto
AlyantoFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Working with Microsoft.Office.Interop.Excel

I am trying to write using interop an excel book with multiple sheets.  I find that I am unable to get a good code sample to work with.  What I am looking for in the simplest level is a guide that shows how to add multiple worksheets to a workbook or even better still a very small code sample.  The is quite a bit more to the project but this appears to me the only stumbling block to completing the project.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Alyanto

ASKER

I am still looking for a little more on this perhaps a bit of psudo code will relate what i am trying to achive and perhaps I can sign off on the points.

Press button for the spreadsheet to be made
Call class xlFactory withcontructor receiving dataset and some structures to define the layout of the spreadsheet  

xlFactory make(dataset, formatInfo)
  in memory Excel application using Interop
  xlFactory make xlWorkbook(dataset, Formatinfo)
    For each table in the dataset
      make a sheet(enum FormatInfo = tablename)
    next
Save the file
do stuff with file i.e. email, open app on decktop etc

Where I keep failing to understand is the creation of the various elements.  I am sure it is really very straight forward but both of the example are fine but the seem to skip over the creation of the book, sheet etc from interop
Avatar of Alyanto

ASKER

Thank for the lead