Run the sample application. If you then check your bin/debug folder, you will see the .xls file that was written. Open that file in Excel 2013 (it could very well happen in other versions of Excel as well) and you will get the "PROTECTED VIEW Office has detected a problem with this file. Editing it may harm your computer. Click for more details."
The fix for development issue 212300 is available in the latest service release which can be downloaded from the My Keys and Downloads page.
Hello Jon,
I have reproduced the issue you are referring to, as "sample breakage.xlsx" does not currently open in protected view on my machine, but it does when I open it in Excel, with the same red message that you are seeing. After a bit of testing, this does not appear to have to do with the XamSpreadsheet, but rather the Infragistics Excel Framework itself.
This appears to be unexpected behavior, and as such, I have asked our engineering staff to examine this issue a bit further. To ensure that it receives attention, I have logged this issue in our internal tracking system with a development ID of 212300. I have also created you a support case on this matter. It has an ID of CAS-168287-W2G1W4 and you can access it at https://es.infragistics.com/my-account/support-activity after signing into your account.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Wow... That's 0/2 on sending the right files.
These are the correct files.
In the newly attached files, if I open WpfApplication1\sample breakage.xlsx in Excel 2013 everything is fine (not in protected view).
Then run the application or just open WpfApplication1\bin\Debug\opens_in_protected_view.xls and you will see that the file opens in protected view.
Like you said, there is some issue with the file validation.
Inspecting sheet.Workbook.IsProtected shows false all the way through.
Thank you for attaching your new sample with the new Excel workbook. I am a little unclear on your most recent response, though. In it, you had said "sample_breakage2.xlsx opens in ProtectedView, and even unchecking all three Protected View options results in Protected View." Would it be possible for you to please verify or refute that when simply trying to open the sample_breakage2.xlsx file on your machine with Excel 2013, it opens in protected view?
The reason that I ask is the above is because if you are loading a workbook that is set to open in protected view and then you save it to a new file like you were in your original sample, that new workbook that was saved will continue to open in protected view. I did a bit of research on the different Excel protected view messages, and ended up finding this site: https://support.office.com/en-nz/article/What-is-Protected-View-d6f09ac7-e6b9-4495-8e43-2bbcdbcb6653. From that site, it appears that the message that you are seeing is being caused by some sort of file validation failure. I'm not entirely sure why this is at the moment, to be honest. It may be something on Excel's side. I did notice though, that by manually opening the file in Excel and unprotecting or "trusting" it prior to running the application, I was not able to reproduce this protected view issue that you are seeing with the 15.2.20152.2038 assemblies.
One thing that I did find a little bit strange with the XamSpreadsheet is that after loading the protected workbook into a Workbook object in your application, I tried calling sheet.Workbook.Unprotect() prior to exporting it and changing the format, but the file still opened in protected view in Excel when the file loaded into a workbook opened in protected view in Excel. What I would like you to try on your end is before exporting your workbook to a new Excel file, I would like to know the returned variable of the following statement: sheet.Workbook.IsProtected;, where "sheet" is the XamSpreadsheet. Would it be possible for you to please provide some information regarding that, and whether the workbook is starting as protected on your machine?
I did attach an old set of sample files. Sorry about that.
Here are the files with the issue reproduced.
sample_breakage2.xls opens in Protected View, and even unchecking all three of the Protected View options (originating from the Internet, potentially unsafe locations, and Outlook attachments) results in Protected View.
I can see how you would probably get the "originating from the Internet" protected view message.
This is what I see:
https://www.microsoft.com/global/security/publishingimages/pc-security/protected_view_no_enable_bar.jpg
https://www.microsoft.com/global/security/publishingimages/pc-security/protected_view_edit_anyway.jpg
Let me know if you have any other questions.