ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
225 stars 75 forks source link

Copy style to a data #458

Open SEvisual opened 9 months ago

SEvisual commented 9 months ago

Is your feature request related to a problem? Please describe. I want to do the following: 1.read the EXCEL file with the edited styles 2.apply those styles to the new data 3.save it

Describe the solution you'd like

wb<- loadWorkbook("QC.xlsx") 
writeData(wb, 1, NewData, startCol=1, startRow=1, rowNames=FALSE, colNames=TRUE)
saveWorkbook(wb, QC2.xlsx", overwrite=TRUE, returnValue=TRUE)

Additional context

  1. I have found that if the new data is large compared to the data readed in , the result is that parts of the new data don't have style
  2. if the new data is small compared to the data readed in , the result will contain the readed-in data

Is there a better way to do this?

Thanks in advance!