awalker89 / openxlsx

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

Saving workbook breaks external references #466

Open mschwartsman opened 5 years ago

mschwartsman commented 5 years ago

Expected Behavior

I expect that openxlsx to write data in the specified cells and not to interfere with any links outside the range I established.

Actual Behavior

I've tried to update to workbooks recently and whenever I save them - or merely load and overwrite a workbook -, some links to other workbooks are broken. They only display #REF!, and if I try to update the cells, the reference changes to another linked file.

Steps to Reproduce the Problem

  1. Load an xlsx workbook with more than one external reference - "Test.xlsx" in my toy example, which is linked to "Ref1.xlsx" and "Ref2.xlsx"

  2. Overwrite the workbook - all links to "Ref2.xlsx" are broken and if one tries to update them, they will revert to "Ref1.xlsx".

Ref1.xlsx Ref2.xlsx Test.xlsx

sessionInfo()

R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)