I’m using Interop to open and read Excel files.
rangeBegin = templateWorksheet.get_Range(<special cell adressing goes on here>);
so it is easy to get the value and formulas out of cells and mopdify this stuff.
what is bugging me now is how to read and modify cell names as they are used within formulas and I might have to add/remove or alter the named cells or their reference.
could not yet figure a way to do so and did not find information on how to do it properly.
Thanks for answer
€dit:
As I got not enough reputation I have to edit the question to add the answer:
(@KAJ: Thanks!)
A way to access names:
using Excel = Microsoft.Office.Interop.Excel;
Excel.Names tmp5 = workBook.Names;
addNews(tmp5.ToString());
addNews(tmp5.Count.ToString());
addNews(tmp5.Item(1).Name);
addNews(tmp5.Item(1).Index.ToString());
addNews(tmp5.Item(1).RefersTo);
where “addNews” is a function that give me debug output within a list that can easily be copied to clipboard. (formatted plus date and time information)
The usual way to work out the slightly obscure Excel API is to record a macro and then look at the code it generates.
Having done this for naming a cell it does:
So there may be something similar via interop