Access to excel cell by name

I am trying to set the excel cell name for some username and later access that cell by its name. Is there any of the API API calls to do this, or how to do it if I have information about the worksheet and cell name in case of accessing the cell and the worksheet and cell address (i.e. C2) in case of cell naming .

Also ask if there is a way to get formatting information tied to this particular cell? (i.e. when I access a cell by name, I want to return the cell value and some formatting properties of this cell, if the cell is a number or text, is it highlighted, etc.)

Yours faithfully,

Vladimir Vaida

+4
source share
1 answer

I think you can look for Range("C2") .

As for formatting information, this is available through various properties of the Excel object model. See http://msdn.microsoft.com/en-us/library/ff197454.aspx for more details.

Type Range (as opposed to the above-mentioned properties of Range indexed) also provides property Name , which you can set in the code:

 worksheet.get_Range("C2").Name = "fdafdfs" worksheet.get_Range("fdafdfs").Select(); 
+7
source

Source: https://habr.com/ru/post/1380463/


All Articles