Rodzina oprogramowania arkusza kalkulacyjnego firmy Microsoft z narzędziami do analizowania, tworzenia wykresów i komunikowania danych.
Hi Joanna,
What you're seeing is expected.
After the Microsoft 365 integration, Excel treats files in cloud-synced locations as potentially coming from the Internet, so macro policy kicks in always. Moving the file to Desktop works because that trust check no longer applies there. The clean fix (without weakening security) is to digitally sign the workbook's VBA and trust the publisher. Once signed, Excel will run the macros from your cloud location.
Try this. Close Excel, then run SelfCert.exe (installed with Office, typically under C:\Program Files\Microsoft Office\root\Office16\SelfCert.exe), create a certificate and give it a name. Next, open your workbook, press Alt+F11 to open the VBA editor, go to Tools > Digital Signature... then choose your certificate, confirm and save and close the file.
Now, in Excel, open File > Options > Trust Center > Trust Center Settings > Macro Settings and choose either "Disable all macros with notification" or the stricter "Disable all macros except digitally signed macros". Now open the workbook from the cloud folder. When prompted, choose "Trust all documents from this publisher". From that point on, the macros should run from your cloud location without further warnings, and you can reuse the same certificate to sign other workbooks.
If the setting "Block macros from running in Office files from the Internet" is enforced by your organization and looks greyed out, that's fine, a trusted signature still takes precedence. If several colleagues use the file, export the certificate's public key and add it to their Trusted Publishers store, or sign with an organization code-signing certificate.
I hope this helps! Let me know the results please.