Skip to content
Advertisement

Hide Multiple Excel Worksheets

I am using the Perl module Excel::Writer::XLSX to write an Excel workbook in Linux. I am writing to three separate worksheets and am trying to hide the first two so that only the third worksheet is visible.

Perl Code:

$worksheet3->activate();
$worksheet1->hide();
$worksheet2->hide();

Instead, using the code below, only the first worksheet tab is being hidden.

What am I doing wrong?

Advertisement

Answer

# Sheet2 won't be visible until it is unhidden in Excel.
$worksheet1->hide();
$worksheet2->hide();

Please activate the excel after the hidden sheets.

$worksheet3->activate();

I have tested this.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement