openxlsx
openxlsx copied to clipboard
cloneWorksheet() should work across workbooks
Currently cloneWorksheets only works for copying sheets within a single workbook. I would like to be able to take a sheet from one workbook and copy it into another. My use case for this is having a stock notes or other sheets which I can read and then insert into my openxlsx created workbooks
notes_wb <- loadWorkbook("notes.xlsx")
final_workbook <- createWorkbook()
writeData(final_workbook , "Data", data)
cloneWorksheet(final_workbook, "Notes", notes_wb $worksheets[[1]])
saveWorkbook(final_workbook, file = "final.xlsx")
Please check the current package repository ycphs/openxlsx.
@ycphs I installed the latest, the behavior of cloneWorksheet seems to be unchanged. Any idea how to effectively copy a worksheet object from one workbook to another? Thanks!