I'm developing an Excel Addin that fills a sheet with information from a web page.
There's a button that shows two more columns, I get the information and fill the columns, and after that, if the button "Show this columns" is not pressed, I hide them:
Range gColumn = swatDataSheet.Columns["G"];
Range hColumn = swatDataSheet.Columns["H"];
if (!showOmniWorksButton.Checked)
{
gColumn.Hidden = true;
hColumn.Hidden = true;
}
else
{
gColumn.Hidden = false;
hColumn.Hidden = false;
}
The first time everything works correctly, but if I refresh the sheet and fill it again, everything starts from the column I've hidden before, even if it's not hidden now. If my data starts on A1, after remove and fill again it starts from the column I hid, G1.
Is this a bug or am I doing something wrong?
Thank you.