HC_2016
HC_2016

Reputation: 67

Why is read_excel very slow while the excel file to read from R is also opened in the Excel?

The environment is: R: 3.6.1 readxl version: ‘1.3.1’

When I close the Excel program, read_excel takes a second or 2, but when I have the file opened in Excel, then read_excel in R can take a few minutes.

I wonder why was that?

Upvotes: 2

Views: 1046

Answers (1)

cymon
cymon

Reputation: 413

Some programs, like Excel, put access restrictions on files while the files are open. This prevents accidental conflicts from external changes to the same file while it is open.

I don't know why specifically it would affect other tools from reading the file and why the effect would manifest as slower speed instead of complete inability. Maybe Excel is trying to monitor the access to the file and compare it to the content it has loaded.

Upvotes: 1

Related Questions