1
2
3
4
5
6
7
8
9
//Microsoft.Office.Interop.Excel.Worksheet & Microsoft.Office.Tools.Excel.Worksheet are different.

Microsoft.Office.Interop.Excel.Worksheet activeSheet = (Microsoft.Office.Interop.Excel.Worksheet)Globals.ThisWorkbook.ActiveSheet;

activeSheet.get_Range("A1", System.Type.Missing).EntireColumn.Hidden = true;

//or

Microsoft.Office.Tools.Excel.Worksheet.InnerObject.get_Range("A1", System.Type.Missing).EntireRow.Hidden = true;