I have built an xlsx and csv file reader with php using phpspreadsheet as reader but when reading files that are password protected it is not possible. Searching the documentation it says that " phpspreadsheet can read spreadsheets that are protected. You don't need to know the password or do anything special to read a protected file. " Reading. Does anyone know anything regarding this?
The explanation you saw in the documentation refers to protecting the file (from modification), not encrypting the file. Read a protected file, of course you can (because you don't need to modify it, just read it).
Opening encrypted files cannot be done with just PHPSpreadsheet. You have to decrypt it and hand the result over to PHPSpreadsheet to work (xlsx for example is a glorified zip with a bunch of files inside, more or less following the OOXML spec).
There are people who have created things like this to deal with that problem. The author of this library suggests something like this (although he clarifies that the code is dirty and he doesn't recommend using it in production):
P.S. For future questions, try to share the code that generates the error you show. Well, how not to guess