I'm trying to export my workbook object with openxlsx2 package, but I got an error message as following.
dat2 = wb_load("data.xlsx" ,data_only = F, calc_chain = T)
num = c(600000,12340)
dat2 = dat2 %>% wb_add_data(sheet = 1, x = num, dims = "E17")
wb_save(dat2, file = 'QQQ.xlsx', overwrite = F)
Error in `$<-.data.frame`(`*tmp*`, tmpDirPartName, value = "C:\\Users\\nergul18\\AppData\\Local\\Temp\\RtmpCKmbVx\\workbookTemp_b0cc4801ed2/xl/worksheets/") :
replacement has 1 row, data has 0
What does this error mean and How do I handle this one?
R version 4.2.3, openxlsx2_1.0"data.xlsx"? I just tested with a spreadsheet of my own, and it also worked without error. Linux, R-4.3.1, openxlsx2-1.1tmpDirPartName(and github.com/JanMarvin/openxlsx2/blob/…), it seems likely that this is a bug in the package. I suggest you open a new bug report, where it will be even more important to make this reproducible, either by providingdata.xlsxthat generates the error, or creating anxlsxfile programmatically that triggers the error. Good luck!calc_chainoption. Setting this has the tendency to brick your file!workbook.xml.relsorContent_Types. I wasn't aware that either case is possible.