|
-
October 5th, 2009, 10:49 AM
#1
Excel - Referencing a named range
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|