Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
sarathi_pm
Contributor II
Contributor II

Loop Through St.Table to get the hidden column values through macro

Hi,

I want to loop through a straight table where in i want to get the values of the hidden columns as well? Is there any way that i can do this?

As of now the below code loops through the table's column, but fetches only the visible column data.

set table = ActiveDocument.GetSheetObject("CH01")

for RowIter = 0 to table.GetRowCount-1
     for ColIter =0 to table.GetColumnCount-1
          set cell = table.GetCell(RowIter,ColIter)

          msgbox cell.Text

     Next

Next

Any suggestion pls.

Thanks

Sarathi

2 Replies
Anonymous
Not applicable

Yes, this macro can't read hidden columns.

Can you just squeeze the column width to 0 instead of hiding it?  Another option, make it reasonably narrow, and use font color same as background (e.g. white on white).

Yet another possible solution - un-hide column in the beginning of the macro and hide at the end.

Regards,

Michael

sarathi_pm
Contributor II
Contributor II
Author

Hi Michael.

Thanks for spending time and helping me.

The work around looks good.

Thanks

sarathi