If you open an xlsm file with macros and then simply save the xlsm file, the number of sheets shown in the visual basic window should be the same..
Actual Behavior
Phantom sheets are generated. If I open an extremely simple workbook with macros and then save it, it generates a set of phantom sheets with the macros moved to the phantom sheets.
Steps to Reproduce the Problem
(please attach an example xlsx file if possible)
Run the small test
library(openxlsx)
wb <- loadWorkbook("BeforeTest.xlsm")
saveWorkbook(wb, "AfterTest.xlsm", overwrite = TRUE)
Expected Behavior
If you open an xlsm file with macros and then simply save the xlsm file, the number of sheets shown in the visual basic window should be the same..
Actual Behavior
Phantom sheets are generated. If I open an extremely simple workbook with macros and then save it, it generates a set of phantom sheets with the macros moved to the phantom sheets.
Steps to Reproduce the Problem
(please attach an example xlsx file if possible)
Run the small test library(openxlsx) wb <- loadWorkbook("BeforeTest.xlsm") saveWorkbook(wb, "AfterTest.xlsm", overwrite = TRUE)
Review the output in Excel - see JPG
Commands.txt
sessionInfo()