awalker89 / openxlsx

R package for .xlsx file reading and writing.
Other
364 stars 79 forks source link

xlsm corrupted #447

Open gmoores opened 5 years ago

gmoores commented 5 years ago

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)

  1. Run the small test library(openxlsx) wb <- loadWorkbook("BeforeTest.xlsm") saveWorkbook(wb, "AfterTest.xlsm", overwrite = TRUE)

  2. Review the output in Excel - see JPG

Commands.txt visualbasiccomparison

sessionInfo()