How can I calculate an entire workbook, but not all open workbooks?
excel, vba
Solution
After some investigation and testing, selecting all sheets first and calculating afterward works:
Application.Calculation = xlManual
ThisWorkbook.Sheets.Select
ActiveSheet.Calculate
This calculates all selected sheets at the same time creating the right order of calculation.
Problem
Is there a way to calculate entire workbook but not all open workbooks in VBA? I know about ``` worksheet.Calculate ``` but it will only do 1 sheet. I also know about ``` Application.CalculateFull ``` But I think this recalculate all open workbooks at the same time. Is it possible to do only 1 workbook? Edit: I get the approach: ``` For Each wks In ActiveWorkbook.Worksheets wks.Calculate Next ``` but this is very dangerous if sheets have links between them, then the order of calculation is important. I know I could find the exact sequence and apply it, problem is that on very large workbooks this can get somewhat tricky