Handling office.js worksheet import issues with "extension hardening" level 2
Hello,
we stumbled upon a problem with our Excel Add-in recently and are a little stumped. We are creating excel worksheets using Excel.createWorkbook()
and insertWorksheetsFromBase64()
to import data from a third party API into excel.
For security reasons however, some clients prefer to set their local policies "Force file extension to match file type" to strict (2; always match file type), within the excel security policies, which breaks the office.js functions used here. This issue is always present and seems to be by design judging from the answers in this Github issue.
Unfortunately, setting the policy to 1 (Allow different, but warn) is not enforceable in this case. Are there other options to facilitate similar functionality in the javascript API which does not trigger this security behavior?
To reproduce this issue, any add-in using the mentioned functionality with a strict extension hardening policy (level 2) should be sufficient, regardless of office.js-version or excel version as long as they are compatible (older office.js versions might outright crash the application; newer versions handle the exception).
The goal would be to enable worksheet creation from xlsx-documents which should not trigger the extension hardening policy, either by working around the security-policy or by using alternative functions that conform to the policy.
Thank you in advance!