-
Notifications
You must be signed in to change notification settings - Fork 77
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
When I use R1C1 cell references in writeFormula(), I am unable to open the resulting excel file without error. I have already verified that R1C1 references are enabled in my excel preferences and that I can use R1C1 referencing directly in excel.
Here is a minimum working example:
wb <- openxlsx::createWorkbook()
ws <- 'test_sheet'
openxlsx::addWorksheet(wb, sheetName = ws)
writeData(wb = wb, sheet = ws, x = 2, startCol = 1, startRow = 1)
writeData(wb = wb, sheet = ws, x = 4, startCol = 2, startRow = 1)
writeFormula(wb = wb, sheet = ws, x='=RC[-2] * RC[-1]', startCol = 3, startRow = 1)
saveWorkbook(wb, 'test.xlsx')
Describe the solution you'd like
The option to pass equations using R1C1 cell references in writeFormula.
Describe alternatives you've considered
The obvious alternative is to use the standard A1 referencing. However, R1C1 is much more convenient for some applications.
Additional context
Screenshots of excel error when I use R1C1: