also available as:
The tech support is by far the best I have ever worked within 27 years of development. Questions are answered quickly and program fixes are created and are made available.
– Dennis
|
Read and write Excel XLS, XLSX, CSV files |
Bytescout Spreadsheet SDK is a clean and simple API to read and write Excel files.
Almost in every business application we need to have the ability to read and write Excel files. Using Bytescout Spreadsheet SDK is a simple way of reading and writing Excel files using Visual Basic.
Sample source code – write data to Excel file in VB.NET:
Imports Bytescout.Spreadsheet
Imports System.IO
Module Module1
Sub Main()
Dim document As New Spreadsheet()
Dim worksheet As Worksheet = document.Workbook.Worksheets.Add("HelloWorld")
worksheet.Cell(0, 0).Value = "Hello, World!"
' remove output file if already exists
If File.Exists("Output.xls") Then
File.Delete("Output.xls")
End If
' Save document
document.SaveAs("Output.xls")
' Close Spreadsheet
document.Close()
' open in default spreadsheets viewer/editor
Process.Start("Output.xls")
End Sub
End Module
Sample source code – read data from Excel file in VB.NET:
Imports Bytescout.Spreadsheet
Imports System.IO
Module Module1
Sub Main()
' Create new Spreadsheet
Dim document As New Spreadsheet()
document.LoadFromFile("Hello_world.xlsx")
' Get worksheet
Dim worksheet As Worksheet = document.Workbook.Worksheets.ByName("Sheet1")
' Read cell value
Console.WriteLine("Cell (0,0) value: {0}", worksheet.Cell(0, 0).Value)
' Write message
Console.Write("Press any key to continue...")
' Wait user input
Console.ReadKey()
End Sub
End Module
Find all sample source codes for Visual Basic and ASP.NET in a free trial of Spreadsheet SDK. Download now!
[socialpug_share]