
Hi,
Here are a few suggestions-
Check Calculation Settings: Verify that the calculation settings in Excel are set to automatic. You can go to the Formulas tab, click on Calculation Options, and ensure that "Automatic" is selected. This ensures that the formulas recalculate automatically.
- Force Calculation: Before generating the PDF file, you can explicitly trigger a calculation in the destination sheet using the
Calculate
method. - Wait for Calculation: If the formulas take some time to recalculate, you can introduce a brief pause in your VBA code using the
Application.Wait
method. - Ensure Events are Enabled: In some cases, events may be disabled, preventing the automatic recalculation of formulas. You can check if events are enabled by going to the VBA editor and ensuring that
Application.EnableEvents
is set toTrue
.
I hope this works!
But there is also a possibility that your Excel workbook got corrupted. For that, you can try to repair Excel file using the Open and Repair method.
Best Regards.