Functions to force formula calculation or refresh of pivot tables when the Excel file is opened.
forceFormulaRefresh(file, output = NULL, verbose = FALSE)
forcePivotTableRefresh(file, output = NULL, verbose = FALSE)
the path of the source file where formulae/pivot table needs to be refreshed
the path of the output file. If it is NULL
then the source file will be overwritten
Whether to make logging more verbose
Does not return any results
forcePivotTableRefresh
forces pivot tables to be refreshed when the Excel file is opened.
forceFormulaRefresh
forces formulae to be recalculated when the Excel file is opened.
# Patch a file where its pivot tables are not recalculated when the file is opened
if (FALSE) {
forcePivotTableRefresh("/tmp/file.xlsx")
forcePivotTableRefresh("/tmp/file.xlsx", "/tmp/fixed_file.xlsx")
}
# Patch a file where its formulae are not recalculated when the file is opened
if (FALSE) {
forceFormulaRefresh("/tmp/file.xlsx")
forceFormulaRefresh("/tmp/file.xlsx", "/tmp/fixed_file.xlsx")
}