Solved

Working with Microsoft.Office.Interop.Excel

Posted on 2012-03-29
3
292 Views
Last Modified: 2012-04-03
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.
0
Comment
Question by:Alyanto
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 37782836
Check following samples

http://www.dotnetperls.com/excel-vbnet

http://support.microsoft.com/kb/301982


To add a sheet, you can call the workbook.Sheets.Add method.
0
 
LVL 1

Author Comment

by:Alyanto
ID: 37786515
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
0
 
LVL 1

Author Closing Comment

by:Alyanto
ID: 37802682
Thank for the lead
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question