Archive

Posts Tagged ‘Excel’

Editing Excel Sheets using Microsoft.Office.Interop.Excel in C#

I found my self repetitively entering data into an excel sheet and needed to automate it using C#.

First add a reference of Microsoft.Office.Interop.Excel to your project.

To open a work book


using Microsoft.Office.Interop.Excel;
...
...
var m_TemplateFileName = "/path/to/excel/file/to/edit.xls";
var m_InputWorkSheetName = "input";
var application = new ApplicationClass();
var workBook = application.Workbooks.Open(m_TemplateFileName);
...
...

Read more…

Categories: Programming Tags: , ,