<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl

#######################################################################
#
# Example of how to hide a worksheet with Excel::Writer::XLSX.
#
# Copyright 2000-2020, John McNamara, jmcnamara@cpan.org
#

use strict;
use warnings;
use Excel::Writer::XLSX;

my $workbook   = Excel::Writer::XLSX-&gt;new( 'hide_sheet.xlsx' );
my $worksheet1 = $workbook-&gt;add_worksheet();
my $worksheet2 = $workbook-&gt;add_worksheet();
my $worksheet3 = $workbook-&gt;add_worksheet();

$worksheet1-&gt;set_column( 'A:A', 30 );
$worksheet2-&gt;set_column( 'A:A', 30 );
$worksheet3-&gt;set_column( 'A:A', 30 );

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

$worksheet1-&gt;write( 0, 0, 'Sheet2 is hidden' );
$worksheet2-&gt;write( 0, 0, "Now it's my turn to find you." );
$worksheet3-&gt;write( 0, 0, 'Sheet2 is hidden' );

$workbook-&gt;close();

__END__
</pre></body></html>