Open an Existing Excel File
Nasosoft Excel for .NET provides variable ways to open an existing Excel file. With specified file location and file format type, you can load Excel file formats or other data file formats easily.
Open an Excel File with Specified Path
Code Example:
//Create a Workbook object, and open an Excel file with specified path
XlsWorkbook workbook = new XlsWorkbook("book1.xls");
'Create a Workbook object, and open an Excel file with specified path
Dim workbook As New XlsWorkbook("book1.xls")
Open an Excel File with Specified Stream
Code Example:
FileStream fstream = new FileStream("book1.xls", FileMode.Open);
//Create a Workbook object, and open an Excel file with specified stream object
XlsWorkbook workbook = new XlsWorkbook(fstream);
Dim fstream As FileStream = New FileStream("C:\book1.xls", FileMode.Open)
//Create a Workbook object, and open an Excel file with specified stream object
Dim workbook As XlsWorkbook = New XlsWorkbook(fstream)