I don't know who market my thread "Unable to Show/Hide NamedRange object from the ActionPane" as answered. (May be me by mistake...). In fact it is still unanswered and some additional info provided in my last post there.
So, can moderator reopen the thread and possibly answer my questions
In case the answer to the previous question is "No", I'm starting this thread with the same problem.
1. I have the folloving code in the Click event handler:
private void btn_RangeShowHide_Click(object sender, EventArgs e) {
Tools.NamedRange nr = Globals.Sheet6.Controls["subj_1"] as Tools.NamedRange;
if (null == nr) return;
object h = nr.Hidden;
}
2. I created NamedRange subj_1 ocupied several columns.3. I'm trying to Hide/Unhide this range via NamedRange's Hidden property.
4. When I run my project and hit the button I've got an exception in line where I'm reading this property. For simplicity I removed code which changes property.
5. The exception is "System.Runtime.InteropServices.COMException (0x800A03EC): Unable to get the Hidden property of the Range class" Full stack trace is in my previous post with the same subj.
6. My NamedRange represents several full columns. I can Hide/Unhide it from context menu.
7. The exception occurs even for the range, which contains only one column.
8. I tryed to show and select my NamedRange with Show() and Select() methods but UNSUCCESSFULLY.
My questions are
1. Can anyone reproduce the problem
2. Is there any way to Hide/Unhide the range programmaticaly
Boris

Still Unable to Show/Hide NamedRange object from the ActionPane!!!
Mike Jay
It works.
Thank you.
Boris
Sharathv2
Try accessing the Hidden property through the EntireRow or EntireColumn property of the NamedRange.
So, instead of the following line:
object h = nr.Hidden;
Try:
object h = ((Microsoft.Office.Interop.Excel.Range)nr.EntireColumn).Hidden;
I hope this helps,
McLean Schofield