Forum Discussion
Sandeep272003
Jun 07, 2023Copper Contributor
Macro not working with office 365 when downloading report from SAP
Hi,
We were using Citrix and there we have SAP and Office 2010. There are many reports where we are using macros and office 2010 and that is working fine.
Now, in our local machine IT team have changed the office 2010 to office 365 and we don't want to use Citrix any more so when we are accessing the same program in local system using office 365 macros its not working.
Any idea or suggestion will be highly appreciated.
Regards,
Sandeep
- NikolinoDEGold Contributor
When migrating from Office 2010 to Office 365, there can be compatibility issues with macros due to changes in the VBA (Visual Basic for Applications) environment and security settings. Here are a few suggestions to address the macro compatibility issue:
- Enable Macros: In Office 365, the security settings for macros are generally more restrictive. Make sure that you have enabled macros in the Trust Center settings. Go to "File" > "Options" > "Trust Center" > "Trust Center Settings" > "Macro Settings" and select the appropriate option to enable macros. Note that enabling macros may pose security risks, so be cautious and ensure that the macros you are running are from trusted sources.
- Update Macro Code: Check if the macro code you are using is compatible with Office 365. Some older macro code may not work correctly in newer versions. Review the code and make any necessary updates or modifications to ensure compatibility.
- References and Libraries: If your macros rely on external references or libraries, ensure that those references are properly set in the Office 365 environment. Check the VBA editor's "Tools" > "References" menu to verify and update any missing or outdated references.
- Compatibility Mode: If you have existing Excel files with macros created in Office 2010, you can try opening them in Office 365 in compatibility mode. This mode aims to maintain compatibility with older versions of Excel and may help with the execution of macros.
- Debug and Troubleshoot: Use the VBA editor's debugging capabilities to identify any specific issues or error messages encountered during macro execution. This can help pinpoint the source of the problem and guide you towards a solution.
If the issue persists, it may be helpful to provide more details about the specific error messages or problems you are encountering when running the macros. This additional information can maybe assist in diagnosing and resolving the compatibility issue.
- Sandeep272003Copper Contributor
- NikolinoDEGold Contributor
When you encounter the "Microsoft Excel Security Notice" stating that macros have been blocked due to the file being untrusted, it means that Excel's security settings are preventing the execution of macros from potentially unsafe sources. To enable the macros and resolve the issue, you have a few options:
- Enable macros for the current file: If you trust the source of the file and want to enable macros for it, you can follow these steps:
- Close the security notice dialog.
- Go to the "File" tab and click on "Options."
- In the Excel Options dialog, select "Trust Center" from the left menu.
- Click on the "Trust Center Settings" button.
- In the Trust Center dialog, select "Macro Settings" from the left menu.
- Choose the option "Enable all macros" or "Enable all macros with notification" if you want to be alerted when a macro runs.
- Click "OK" to apply the changes and close the dialogs.
- Reopen the file, and the macros should now be enabled.
- Move the file to a trusted location: By default, Excel only allows macros to run from trusted locations. You can move the file to a trusted location to enable macros without encountering the security notice. The trusted locations include the default trusted folders such as the "Documents" folder or a custom trusted location you can specify.
- Go to the "File" tab and click on "Options."
- In the Excel Options dialog, select "Trust Center" from the left menu.
- Click on the "Trust Center Settings" button.
- In the Trust Center dialog, select "Trusted Locations" from the left menu.
- Click on "Add new location" to specify a new trusted location, or select an existing trusted location.
- Browse and select the folder where the file is located, or create a new folder.
- Click "OK" to apply the changes and close the dialogs.
- Move the file to the trusted location, and the macros should now be enabled.
Note: Be cautious when enabling macros from untrusted sources, as they can potentially contain malicious code. Ensure that you trust the file and its source before enabling macros.
These steps should help you enable macros for the specific file or allow macros to run from trusted locations, depending on your preference and the level of security you require.