Microsoft Office Tutorials and References
In Depth Information
In this demonstration, you learned how to connect with a Microsoft SQL Server 2008
database in order to get data and populate it in a workbook. This is just one of the
ways of manipulating data outside of a workbook.
A Microsoft Excel file is represented in Excel as a workbook. Each and every
workbook can have many worksheets. Worksheets are individual data grids
within the workbook. The term 'worksheet' refers to the rows and columns of
the sheet on which you are working, whereas the term 'spreadsheet' refers to a
type of computer application.
VSTO helps you to manage Excel worksheets programmatically. Using VSTO's
programming support, you can access worksheets, add worksheets, delete
worksheets, and so on.
Open Visual Studio 2008 and create a solution with all the supporting files
for the development of the Excel solution. Write the following code inside the
ThisWorkbook.cs file. Here, you're going to add and delete worksheets within
your workbook, at runtime, using the VSTO programming.
Code for adding a worksheet to your workbook using VSTO:
private void ThisWorkbook_Startup(object sender,