We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Excel supports two modes of hidden sheets:
veryhidden is only available from the vba editor.
It can be implemented this way:
diff --git a/lib/Excel/Writer/XLSX/Workbook.pm b/lib/Excel/Writer/XLSX/Workbook.pm index a9a488d..ae45dc6 100644 --- a/lib/Excel/Writer/XLSX/Workbook.pm +++ b/lib/Excel/Writer/XLSX/Workbook.pm @@ -2599,7 +2599,8 @@ sub _write_sheet { 'sheetId' => $sheet_id, ); - push @attributes, ( 'state' => 'hidden' ) if $hidden; + push @attributes, ( 'state' => 'hidden' ) if ($hidden == 1); + push @attributes, ( 'state' => 'veryHidden' ) if ($hidden == 2); push @attributes, ( 'r:id' => $r_id ); diff --git a/lib/Excel/Writer/XLSX/Worksheet.pm b/lib/Excel/Writer/XLSX/Worksheet.pm index fa16dd4..6094218 100644 --- a/lib/Excel/Writer/XLSX/Worksheet.pm +++ b/lib/Excel/Writer/XLSX/Worksheet.pm @@ -454,6 +454,25 @@ sub hide { ${ $self->{_firstsheet} } = 0; } +############################################################################### +# +# hide_very() +# +# Hide this worksheet. +# Only possible to enable using vba attribute editor +# +sub hide_very { + + my $self = shift; + + $self->{_hidden} = 2; + + # A hidden worksheet shouldn't be active or selected. + $self->{_selected} = 0; + ${ $self->{_activesheet} } = 0; + ${ $self->{_firstsheet} } = 0; +} +
The text was updated successfully, but these errors were encountered:
I failed to implement a test case that actually works; but for my installation of office the mentioned code gives the required result.
Sorry, something went wrong.
Seems like a reasonable suggestion. I'll look into it.
worksheet: add very_hidden() method
9de5e9b
Request #228
I've added a fix for this to main via the $worksheet->very_hidden() method.
$worksheet->very_hidden()
f19662d
jmcnamara
No branches or pull requests
Excel supports two modes of hidden sheets:
veryhidden is only available from the vba editor.
It can be implemented this way:
The text was updated successfully, but these errors were encountered: