c# Excel library

WorkBook Manipulation(C#)

 
top
Read/Write xls/csv file

load/save workbook from/to xls/csv files.

//load xls file
workBook.read("template.xls");
//load csv file
workBook.CSVSeparator = ';';
workBook.read("template.csv");
//save xls file
workBook.write("result.xls");
//save csv file
workBook.writeCSV("result.csv");

 
top
Read/Write xlsx/xlsm file

load/save workbook from/to xlsx files.

//load xlsx file
workBook.readXLSX("template.xlsx");
//save xlsx file
workBook.writeXLSX("result.xlsx");

 
top
Read spreadsheet xml file

load spreadsheet xml files.

workBook.readXML("template.xml");

 
top
Import data array to workbook

import data array to workbook.

object[,] datas = new object[2, 2] { { "kaka", 4 }, { 23, "haha" } };
workBook.ImportArray(datas, 3, 3);

 
top
Encrypt/Decrypt Excel97-2003 xls file

encrypt/decrypt xls files.

workBook.read("in.xls", "password");
workBook.write("out.xls", "password");

 
top
Encrypt/Decrypt Excel2007-2016 xlsx/xlsm file

encrypt/decrypt xlsx files.

workBook.readXLSX("in.xlsx", "password");
workBook.writeXLSX("out.xlsx", "password");

 
top
Setting Calculation Options

enable/disable auto calculation,calculate manually

//disable auto calculation
workBook.AutoCalc = false;
//calculation max iteration
workBook.MaxIterations = 256;
//calculation max iteration change value
workBook.MaxIterationChange = 0.01;
//calculte the whole workbook
workBook.recalc();