How to unhide all rows in an Excel

Hey everyone,

I need to unhide all rows in an excel. Any suggestion?

ty

Hi @berkaykor,

This topic looks like exact duplicate of below topic which is already under progress.

Thus, would request you to please close this topic and follow another post itself to seek answers effectively.

Regards
Sonali

Hi.
You can download package:
image
and use C# code.
image
Everything works fine.
Don’t forget import namespace Spire.XLS :slight_smile:
C# code (fileName is argument) :

Workbook workbook = new Workbook();
workbook.LoadFromFile(fileName);
Worksheet sheet = workbook.Worksheets[0];
int counter = Convert.ToInt32(sheet.Rows.Length);
for (int rIndex= 1; rIndex <= counter ; rIndex++)
{
bool isHide = sheet.GetRowIsHide(rIndex);
if (isHide == true)
{
sheet.ShowRow(rIndex);
}
}
workbook.SaveToFile(@“result.xlsx”, ExcelVersion.Version2016);

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(in_Filename)

ws = CType(wb.sheets(in_sheetname), microsoft.Office.Interop.Excel.Worksheet)
ws.Activate

ws.Rows.EntireRow.Hidden = False

xlApp.DisplayAlerts = False
xlapp.Visible = False

wb.save
wb.close

Invoke this code, for the ones that need help. I ended up writing the code because couldnt found an answer with given activities.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.