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."
Hello Jon,
Thank you for your post.
I have been looking into this a bit, and I was initially able to reproduce this issue you are seeing. After reading up on Protected View in Excel, I found that Excel files that originate from the Internet may open in protected view, so I tried opening the "sample breakage.xlsx" file that you have attached in Excel 2013 and found that it was originally in protected view. After setting it to not be in protected view, which essentially then "trusts" the file, I am not seeing the "opens_in_protected_view.xls" file opening in protected view when creating it with the sample project you sent.
I believe that this is likely expected behavior, but I believe I need a little bit of information from you on this matter first. When you try opening the "sample breakage.xlsx" file on your machine, does it open in protected view? If so, then the workbook that is created by loading your file via the Infragistics Excel Engine will load in as "protected" and therefore will export as protected as well. Would it be possible for you to please verify the behavior you are seeing with your "sample breakage.xlsx" so I may continue looking into this issue to find out if it is a bug in the Excel engine or whether this is actually expected behavior?
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Sorry. I added another file to the output that was sample_breakage2.xls.
In Excel's Protected View settings, you can uncheck all the protected view settings and it will still open in protected view.
It's a less friendly protected view message where they have to click the message and then click another button inside the settings that says "Edit anyway".
I hope that directing you to the correct file will produce the problem.
I apologize, but I am not seeing any sort of sample_breakage2.xls in the original sample you sent me or on the last post you had made to this thread. Was something supposed to be attached? If so, would it be possible for you to please place the file in a .zip file and try reattaching it?
Also, regarding my previous post, would it be possible for you to please provide some more information as to whether the sample breakage Excel file opens in protected view on your machine as well?
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.
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?
The fix for development issue 212300 is available in the latest service release which can be downloaded from the My Keys and Downloads page.
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.
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.