Skip to content
New issue

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

Function to update "filterPrivacy' from workbook > workbookPr #1152

Closed
JDavidVR opened this issue Feb 16, 2022 · 2 comments
Closed

Function to update "filterPrivacy' from workbook > workbookPr #1152

JDavidVR opened this issue Feb 16, 2022 · 2 comments

Comments

@JDavidVR
Copy link
Contributor

JDavidVR commented Feb 16, 2022

@xuri this is related to #1148 vba improvement

When I create a .xlsm with macro code, it generates this content for xl/workbook.xml

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
          xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"
                 codeName="{8C4F1C90-05EB-6A55-5F09-09C24B55AC0B}"/>
    <workbookPr codeName="ThisWorkbook"/>

And with latest version of excelize:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
          xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
    <fileVersion appName="xl" lastEdited="5" lowestEdited="5" rupBuild="9303"
                 codeName="{8C4F1C90-05EB-6A55-5F09-09C24B55AC0B}"/>
    <workbookPr filterPrivacy="1" codeName="ThisWorkbook"/>

it adds filterPrivacy="1"

the problem with that is that excel does a kind of validation everytime a file with macro is saved, and shows this message:

image

Here are the steps to fix it manually: https://www.extendoffice.com/documents/excel/1908-excel-stop-privacy-warning-on-save.html

image

So that configuration updates the xl/workbook.xml file and removes filterPrivacy="1"

thanks in advance

@JDavidVR
Copy link
Contributor Author

@xuri I think I've figured it out, please can you review this PR: #1154

@JDavidVR
Copy link
Contributor Author

Fixed on this commit: #1159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant