Solutions for .NET Interop Issues involving Sensitivity Labels?

JK 40 Reputation points
2024-02-26T17:59:41.4833333+00:00

We have code that is supposed to create an Excel document via .NET Interop, then save this workbook.

The problem is, starting with Office 365 Build 2312, the sensitivity label functionality has changed, seemingly to accommodate increased restriction on saving workbooks when an organization requires that there be sensitivity labels when saving a document.

If an organization requires that a user supply a sensitivity label for saving, the 'Workbook.SaveAs' function just simply does not even work anymore. Originally, this function would show a sensitivity label popup where the user could set the label, then the function would continue. This would occur regardless of whether the 'EnabledEvents' or 'DisplayAlerts' booleans were set or not, which was good for us.

The preferred solution would be to manually show this sensitivity label popup. However, I cannot find any API call, boolean, or other thing to set that would show this dialog. It does not seem to be possible to show it anymore. This dialog does still seem to exist, as if I load up Excel manually and save without setting the label, it will prompt me with it first before it successfully saves.

I did find that if DisplayAlerts is 'true', the Workbook Close function will show the Excel 'Save As' dialog, which allows the user to save to a location, and specify the sensitivity label at the same time. This is not ideal, however, because we need to be saving to a predictable location for use with temporary files.

I am aware that there is a Microsoft Information Protection SDK library which allows for software to load and specify sensitivity labels. This, however, seems to require some kind of agreement with Microsoft to publish the software? This does not seem ideal either. It would be far preferable for the Office applications to handle the sensitivity label setting themselves, as before.

The only other solution that comes to mind is to use other libraries which can generate Excel documents, without worrying about the sensitivity label at all.

So, I don't know if there is some solution that we missed. Or, if this might be a bug due to the intersection of these three (Intertop, Office, Purview) that might need to be looked at. Thanks.

Office
Office
A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.
1,303 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,377 questions
Microsoft Purview
Microsoft Purview
A Microsoft data governance service that helps manage and govern on-premises, multicloud, and software-as-a-service data. Previously known as Azure Purview.
932 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,489 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Yiannis Papoutsis 10 Reputation points
    2024-03-28T16:54:15.26+00:00

    is there any update?