I have been using the Microsoft.Office.Interop.Excel
library to open Excel, refresh some queries and save. The issue I am running into is this will only work if each computer has the same Excel library as selected in the project installed on the PC.
I see that NPOI can http://npoi.codeplex.com/documentation read and write data to Excel, but what about an even simpler task of open/refresh/save, can NPOI handle this?
If you use this syntax it seems I can open my Excel file, but what about refreshing queries and saving?
using NPOI.HSSF.UserModel;
using NPOI.SS.UserModel;
private void button1_Click(object sender, EventArgs e)
{
HSSFWorkbook hssfwb;
using (FileStream file = new FileStream(@"c:\test.xls", FileMode.Open, FileAccess.Read))
{
hssfwb= new HSSFWorkbook(file);
}