Posted 9 November 2017, 2:51 am EST
I have an Excel workbook I’m trying load using the Spread.Excel.IO.open() function. The workbook contains only one worksheet and the worksheet is password protected. I know the password.
If I try to open the workbook without providing the password, I receive and error message, as I should. The error code is “1” and the error message says, “Incorrect file format”. This message is not as descriptive of the problem as I would hope, but I can live with it.
However, if I then provide the password via the options argument, I get the same error. So I am unable to open the workbook/worksheet.
I know that Excel provides at least 3 ways to password protect workbooks or worksheets.
- You can apply a password to a worksheet.
- You can provide a password to open the workbook using Save As…->Tools->General Options.
- You can provide a password to modify the workbook using Save As…->Tools->General Options.
There may be more because there are different ways to access workbook/worksheet protection attributes and I’m not sure if they yield the same results.
However, the Spread.Excel.IO.open() only provides one “password” option.
Can someone please tell me which password is intended for Spread.Excel.IO.open()?
Also, while there is password protection on my worksheet, it only applies to some of the cells. Others are editable. Can you tell me how to properly load this worksheet so I may edit the proper cells?
Thanks.