>From the following lines of code on an iMac running Catalina 10.15.7library(readxl) fname <- "/Volumes/SD/LabData/Lorentz/Lorentz.xlsx" Helm <- read_excel(fname,sheet="Helmholtz") I get the following annoying error: Error: Evaluation error: zip file To me this makes no sense: the file in question is not a zip file. The excel file in question, however, is either open on excel, or recently opened in excel. Does anyone know about this error, and what to do about it? I am running R version 3.5.1 Thanks for any assistance you can provide. [[alternative HTML version deleted]]
On 01/12/2020 1:51 p.m., Dennis Weygand wrote:> From the following lines of code on an iMac running Catalina 10.15.7 > > > library(readxl) > fname <- "/Volumes/SD/LabData/Lorentz/Lorentz.xlsx" > > Helm <- read_excel(fname,sheet="Helmholtz") > > I get the following annoying error: > Error: Evaluation error: zip file > > To me this makes no sense: the file in question is not a zip file. The > excel file in question, however, is either open on excel, or recently > opened in excel. > Does anyone know about this error, and what to do about it? > I am running R version 3.5.1 > > Thanks for any assistance you can provide.The .xlsx file format is actually a zip file containing a number of XML files. I'd guess that Excel locks it when it's open, to stop two spreadsheets from opening it at once. So the error message could be more informative, but it's probably accurately reporting the immediate problem. Duncan Murdoch
> On Dec 1, 2020, at 1:51 PM, Dennis Weygand <dpweygand at gmail.com> wrote: > > From the following lines of code on an iMac running Catalina 10.15.7 > > > library(readxl) > fname <- "/Volumes/SD/LabData/Lorentz/Lorentz.xlsx" > > Helm <- read_excel(fname,sheet="Helmholtz") > > I get the following annoying error: > Error: Evaluation error: zip file > > To me this makes no sense: the file in question is not a zip file. The > excel file in question, however, is either open on excel, or recently > opened in excel. > Does anyone know about this error, and what to do about it? > I am running R version 3.5.1 > > Thanks for any assistance you can provide.Hi, Current generation MS Office files (ending with an 'x' in the file extension) are ZIP compressed XML files. Thus, the zip error is relevant. If the file that you are referencing actually exists, since the error can indicate a non-existent file (error in name and/or path), it is possible that the file is still open, and read_excel() presumably requires an exclusive read on the file, thus cannot open it in that manner. You might be sure that the file is not in use by Excel or another application, precluding an exclusive lock on the file. If so, close out the other application. Another possibility is that the Excel file is password protected, and thus cannot be read directly, without saving it in an unprotected fashion. Regards, Marc Schwartz