Hi @Teele, Stone ,
The issue you are experiencing with the Excel macro hanging when exporting to PDF via a runbook may be related to the fact that the runbook is running on a hybrid worker. In general, there are limitations to running Excel workbooks in a user interactive session on compute nodes, which may be causing the issue. Additionally, heavy Excel workloads can run slowly in multi-session environments due to default thread limitations.
To troubleshoot the issue, you may want to try
- modifying the macro to export to PDF in a different way, such as using a different library or API.
- splitting the runbook into different stages, each exporting one worksheet to PDF. This can help identify if there is a specific worksheet or part of your Excel file causing the issue.
- adding logging statements to your VBA code to record progress and intermediate steps. This can help identify where the script is hanging.
- using the built-in Run As account in Azure Automation if possible, instead of using a domain service account. Ensure that this account has the necessary permissions on the Hybrid Worker and the target file system.
If these troubleshooting steps doesn't help to solve the issue, then you might have to raise a support ticket and reach out to support team to understand the reason for the issue by checking the runbook job related backend logs or traces.