How can I programmatically modify an Excel file with AIP sensitivity tags?

35 次查看(过去 30 天)
My company has recently decided to make Excel create files automatically with Azure Information Protection (AIP) sensitivity labels. We have programs in MATLAB that modify Excel files, but because of this, they have started to fail when trying to modify the files. Specifically, when using the writetable function, MATLAB shows the following error:
Unable to write to file 'D:\Prueba xlswrite\Benchmark_Colones_1-2años_31-03-2024.xlsx'.
Ensure the file is a valid spreadsheet file and is not password protected.
Is there a way to programmatically provide the credentials needed by Excel to be able to modify the file when it is allowed?

回答(1 个)

Poorna
Poorna 2024-6-3
Hi Ricardo,
I see you are facing errors while modifying excel files that have AIP labels using the "writetable" function.
I suggest you to use COM server functionality provided by MATLAB to make modifications to files for this requirement. You can use the "actxserver" function to create a COM server and use it to read and modify your excel files. These functions provide you much more customizations and settings while reading and writing to Microsoft documents.
Refer to the following documentation to learn more about "actxserver":
Refer to the following documentation demonstrating, reading and writing to excel files using the server:
Refer to the following MATLAB answer that has example code to modify the AIP tags as well:
Hope this Helps!

类别

Help CenterFile Exchange 中查找有关 Use COM Objects in MATLAB 的更多信息

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by