We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Reading a stream from Excel File Anomaly

Hi, 
I have a password protected Excel File. And as I am reading a stream from Excel File, it's(Excel File's) password is getting flushed. Why is it so?
stream = new FileStream(path, FileMode.Open);
IWorkbook wb = XlObj.Excel.Workbooks.Open(stream);

10 Replies

AM Amber May 11, 2012 07:58 AM UTC

Just realized that problem is not with the stream, but the Excel File's password is getting flushed away anyway. What should I do so that my password remains intact while I read the Excel File?


JM Johnson Monohar M Syncfusion Team May 16, 2012 04:54 AM UTC

Hi Amber,

Thank you for using Syncfusion products.

The reported issue is not reproducing at our end. We have created a sample excel file with password and tried to open as a stream. But, it is throwing an exception saying the workbook is protected. Please find a video screen shot of the same from the following link.

Video Screenshot : ScreenCapture_5-16-2012 12.41.34 AM.wmv.zip

Please find the sample from the following link.

Sample Link :
Password_Flushed.zip

It would be better if you could send us a modified sample to reproduce the issue for further analysis. Also, please open an incident for the issue from Direct Trac for further follow-ups and report the issue there.

Please let us know if you need any clarification.

Thanks,
Johnson



AM Amber May 17, 2012 06:20 AM UTC

Hi Johnson,

I was referring to "password to modify" for an Excel File, not "password to open". Please look into that front too.


AM Amber May 17, 2012 06:38 AM UTC

Hi, 

I am giving the code snippet that is flushing the password:

IWorkbook workbook = XlObj.Excel.Workbooks.Open(path, ExcelParseOptions.Default);


RA Rajesh A Syncfusion Team May 21, 2012 11:11 AM UTC

Hi Amber,

Thank you for updating us.

The reported issue is not reproducing at our end. We have created another sample excel file with protected worksheet and opened as a stream. While resaving the file the password is not flushed. Please find a video screen shot of the same from the following link.

Video Screenshot: ScreenCapture_5-21-2012 6.24.50 AM.wmv

Please find the sample from the following link.

Sample Link:
Password_Flushed.zip

It would be better if you could send us a modified sample to reproduce the issue for further analysis. Also, please open an incident for the issue from Direct Trac for further follow-ups and report the issue there.

Please let us know if you need any clarification.

Thanks,
Rajesh.



AM Amber May 26, 2012 02:01 PM UTC

Hi, Rajesh,

I was referring to reading the excel sheet, not writing it. You have written an excel sheet. Please read a password protected excel sheet to check if its password is being flushed.


RA Rajesh A Syncfusion Team May 29, 2012 09:52 AM UTC

Hi Amber,

Thank you for updating us.

 

We were able to reproduce the below reported issues at our side. We have logged an issue report and forwarded to development for further analysis. So we request you to create a new direct-trac incident to further follow up on this issue.

 

Direct-Trac Link: Login

 

Please let us know if you require any further clarifications.

 

Thanks,

Rajesh. A



AM Amber May 30, 2012 09:13 AM UTC

Hi,

Just to add on to our discussion, the excel files are getting modified while reading even when I am not making or saving any changes. I am able to tell this because of the changed "Date modified" of the excel files.

Thanks,
Amber


AM Amber May 30, 2012 03:04 PM UTC

Hi, 

I have got the solution of the problem I was referring to but another issue has risen.
So the thing is:
workbook.Close(saveChanges)
I was closing the workbook as workbook.Close() rather than workbook.Close(false).. 

However now, while I am writing an Excel File, its password is getting flushed. How can I retain the password.

PS[The password I am referring to is the password to modify and not the password to open.] 


JM Johnson Monohar M Syncfusion Team June 4, 2012 03:52 AM UTC

Hi Amber,

Thank you for creating a Direct Trac incident. Kindly follow-up the issue from the incident (94971) created.

Thanks,
Johnson

Loader.
Live Chat Icon For mobile
Up arrow icon