How To Unhide A Column In An Excel Spreadsheet Without Using An Excel Activity ?

How to unhide a column in an Excel spreadsheet, without using an Excel Activity?

Use invoke code activity to execute below VB code,

Dim xlApp As Microsoft.Office.Interop.Excel.Application
Dim wb As Microsoft.Office.Interop.Excel.Workbook
Dim ws As Microsoft.Office.Interop.Excel.Worksheet
xlApp = New Microsoft.Office.Interop.Excel.Application
wb=xlApp.Workbooks.Open("Excel file location")
ws = CType(wb.Sheets("Excel sheet name"),Microsoft.Office.Interop.Excel.Worksheet)
ws.Activate
ws.Range("Column(s) to Hide (e.g. B:B or B:P)").Columns.EntireColumn.Hidden=False
xlApp.Visible=False
wb.save
wb.close

1 Like