Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear error message when attempting to read non-excel file #896

Closed
john-ioannides opened this issue Jan 17, 2024 · 1 comment
Closed

Clear error message when attempting to read non-excel file #896

john-ioannides opened this issue Jan 17, 2024 · 1 comment

Comments

@john-ioannides
Copy link

As I understand that this package is an improvement of the openxlsx package, I've recently switched one of my codes from the old one to this one,

When attempting to read non-excel files, openxlsx::read.xlsx() gave this clear error:

Error: openxlsx can only read .xlsx or .xlsm files

On the contrary, with the same input, openxlsx2::read_xlsx() gives this rather misleading error:

Error in basename(sheets$Target) : object 'sheets' not found
In addition: Warning message:
In unzip(file, exdir = xmlDir) : error 1 in extracting from zip file

I think a clearer error message would be more suitable.

@JanMarvin
Copy link
Owner

Hi @john-ioannides , thanks for reaching out. I tried to fix this recently #887, but it looks like this was unsuccessful. Might have to check for the existence of specific files in the zipped file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants