I've attempted various solutions from Stack Overflow (How to refresh ALL cell through VBA, Getting Excel to refresh data on sheet from within VBA) to refresh cells in Excel VBA without success in Excel 2010.
These methods include toggling the calculation state of the active sheet (ActiveSheet.EnableCalculation = False
followed by ActiveSheet.EnableCalculation = True
), and using Application.Calculate
and Application.CalculateFull
.
Unfortunately, none have worked. Interestingly, manually refreshing a cell via right-click works fine. However, trying to programmatically refresh a cell with Sheets("Name_of_sheet").Range("D424").Refresh
triggers exception 438.
Questions:
Edit:
You could try using Application.Calculation
Application.Calculation = xlCalculationManual
Application.Calculation = xlCalculationAutomatic