Hi folks, I'm tearing my hair out over this one and any help would be greatly appreciated.

I'm trying to reference a named range in my worksheet, but of the two methods that I've found, neither work.

If I use this:

dataRange = Program.application.Names.Application.Names("name of range").RefersToRange;

I receive the following error:
Non-invocable member 'Microsoft.Office.Interop.Excel._Application.Names' cannot be used like a method.


If I try to index it, as some have suggested, like this:

dataRange = Program.application.Names.Application.Names["name of range"].RefersToRange;

I recieve this error:
Cannot apply indexing with [] to an expression of type 'Microsoft.Office.Interop.Excel.Names'


Can anyone tell me what I'm doing wrong?