problem unhiding columns

  • Thread starter Thread starter Jack Fox
  • Start date Start date
J

Jack Fox

I'm using the following C# code as I cycle through Excel worksheets to
unhide columns:

Excel.Range oRange = (Excel.Range) WS.Cells;
try
{
oRange.Activate();
}
catch
{
//...do stuff
}
oRange.EntireColumn.Hidden = false;

(WS is a worksheet object.) This works fine unless the first columns are
hidden, in which case it does not unhide the first columns. I have tried
various means to initialize my range in other ways, none of which have
worked.

(Can't remember why I'm doing the activate. It solved some problem along the
way.)
 
Jack

I have only used vba drom within ecxel to reference excel worksheets s
i am guessing here.


have you tried

ws.Cells.EntireColumn.Hidden = False


before setting oRang
 

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

Back
Top