awalker89 / openxlsx

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

Merge multiple workbook objects and retain formatting #404

Open ejswhear opened 6 years ago

ejswhear commented 6 years ago

Expected Behavior

Can I merge two formatted workbooks into one workbook with multiple sheets?

I would like to be able to add a sheet from an existing workbook to another workbook - retaining the formatting of everything. If I could give addWorksheet a Workbook Object & sheet reference that would be ideal.

Actual Behavior

It seems that I have to add raw data to an Excel Workbook, and then format it. I would like to be able to merge formats - without having to add un-formatted data and then reformat to match its origin.

Steps to Reproduce the Problem

(please attach an example xlsx file if possible)

  1. Allow addWorksheet to accept a workbook object + sheet reference

  2. Allow WriteData to accept a workbook object + sheet reference

sessionInfo()