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

C

Chuck53

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?
 
F

Frank Kabel

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top