Search code examples
c#excelexcel-dna

A little advice on C# - Excel interoperation


Good Afternoon Fellas,

A little advice would be appreciated, I'm approaching a problem by which I need to write an agent which will go to a particular file directory, open an Excel Workbook (which already exists) and will then change the value of two cells (which are always the same cells) to be the current month (at the time of the agent running).

Unfortunately, this is a work project so VSTO is off-limits. ExcelDNA however, I have used before. I'm not looking for someone to 'do my work', but any suggestions of where to look or previous examples would be great.

I've had a poke around myself to no avail, if anyone could point me in a good direction to get started that would be great!

Much appreciated.


Solution

  • Just thinking out loud with excel now having xml backed file format (zipped) it may be easier to make this change by parsing and rewriting the xml, or to use an xml transform [shudder].

    Now the more supported way would be to use a VSTO but you say that is not available. If you look further into the parsing the file format be aware that it is a complex schema, you may find source out there that does the understanding for you.

    $0.02