openxlsx library and excel formulas

It is not entirely clear what you are doing but I think you are overwriting the excel file and wiping out any equations.

It would help if we could see your code

See this FAQ