Build your First App with Nasosoft Excel for .NET
Below tutorial walks-through how to create, build and run your first spreadsheet application using C#.
Please follow the step by step tutorial to create the HelloWorld application:
1. Create a new instance of XlsWorkbook class
2. Create a new Excel document
3. Insert the “Hello, World!” string into the cell in the Excel document
4. Save the Excel document
Example:
//Create a Workbook object
XlsWorkbook workbook = new XlsWorkbook();
Worksheet worksheet = workbook.Worksheets[0];
//Insert a row into the worksheet
worksheet.Range["A1"].Text = "Hello, World!";
//Save the Excel file
workbook.Save("output.xls");
'Create a Workbook object
Dim workbook As XlsWorkbook = New XlsWorkbook ()
'Get the first worksheet
Dim worksheet As XlsWorksheet= workbook.Worksheets(0)
'Insert a row into the worksheet
worksheet.Range("A1").Text = "Hello, World!"
'Save the Excel file
workbook.Save("output.xls")