I've been creating a R Shiny application in which I need to write/modify a sheet from Macro Enabled Excel file (.XLSM) using R. I came up through three packages that deals with this problem: xlsx, openxlsx, XLConnect.
With openxlsx package, I'm able to modify the data from a specific sheet that I want to but meanwhile, all the other sheets present in file lose its entire data. Other packages are not helping me too.
The problem is happening only with .XLSM extension file. When I run same with .XLSX file, everything goes good and smooth.
WB <- loadWorkbook("Abc.xlsm")
writeData(WB, sheet = "Sheet1", dataToPaste, colNames = F)
saveWorkbook(WB,"Abc.xlsm",overwrite = T)