it was a Microsoft 365 Insider Beta issue; with today’s update, there is no problem anymore.
The current .NET security policy prohibits C:\Users\...\File.xlsx from loading custom macros.
I am working on a project in Visual Studio Community 2022. The project is an Excel VSTO Workbook using Visual Basic (Target framework is .NET Framework 4.8). Up until yesterday everything was working fine, I could run and debug my project whenever I needed to but yesterday I updated Visual Studio and now when I try to debug the program I get the following alert from Microsoft Office:
"The current .NET security policy prohibits C:\Users...\FileName.xlsx from loading custom macros. You can still edit and save the current document. Contact your IT administrator or the author of the custom macros for further assistance."
The following are the things I've done to try and solve this issue:
- Went back to the previous version of Visual Studio.
- Ran sfc /scannow command on the cmd and there were no system violations
- Updated my .NET Framework to the latest version.
- Repaired Visual Studio
None of these made any progress on solving this issue.
I also created a new VSTO Workbook projects but this time with a target framework of .NET Framework 4.7.2 but I keep getting the same message when I try to debug it or run it on Release mode.
I am running Windows 11 and 64-bit Office with Microsoft 365 subscription.
My current Visual Studio Community 2022 version is 17.4.2
My current Excel version is Version 2303 Build 16.0.16110.20000
When I check my current .NET Framework version on CMD it shows:
Microsoft (R) Build Engine version 4.8.9032.0
[Microsoft .NET Framework, version 4.0.30319.42000]
I have the same problem, I tried to solve it in a similar way and no good result so far. It's definitely not a coincidence, it's an update problem.
Sign in to comment