ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How do I check for a range name within Excel using C# (https://www.excelbanter.com/excel-programming/316612-how-do-i-check-range-name-within-excel-using-c.html)

Chuck53

How do I check for a range name within Excel using C#
 
I am looking for a way to search an Excel Workbook for the existance of a
particular range name that may or may not exist. Does get_Range return a
trappable error message?

Frank Kabel

How do I check for a range name within Excel using C#
 
Hi
a VBA solution

dim oName as name
on error resume next
set oname=activeworkbook.names("your_range_name")
if oname is nothing then
msgbox "Name does not exist"
else
'do something
end if

--
Regards
Frank Kabel
Frankfurt, Germany

"Chuck53" schrieb im Newsbeitrag
...
I am looking for a way to search an Excel Workbook for the existance

of a
particular range name that may or may not exist. Does get_Range

return a
trappable error message?




All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com