I am using the Microsoft.Office.Interop.Excel
reference in order to have some manipulations with excel files, like adding columns, locking cells, protecting with password etc...
Now I have to use this code on a server that doesn't have office installed on it, so I don't really know for sure if the code using this reference will be able to run there.
So is there a way of doing all these actions on excel files on a server that doesn't have office installed on it ?
Should I use another library or is there a way that the Microsoft.Office.Interop.Excel
reference to work with no office installed ?
using (ExcelPackage xlPackage = new ExcelPackage(existingFile)) { // get the first worksheet in the workbook ExcelWorksheet worksheet = xlPackage. Workbook. Worksheets[1]; int iCol = 2; // the column to read // output the data in column 2 for (int iRow = 1; iRow < 6; iRow++) Console. WriteLine("Cell({0},{1}).
Yes, you are right. You need Excel to be installed to use the Excel Manipulation feature with Microsoft. Office. Interop.
You can use EPPlus. It works with Open Office Xml format. No need to install any Office component on the server. https://github.com/EPPlusSoftware/EPPlus
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With