George Spears
Posts: 79
Joined: 2010-05-06
|
Hello,
I have written an Excel plug in...
I have a line in my code that normally works fine. It reads the value of the selected cell.
MycellText := ExcelApp.ActiveCell.Value;
This line does NOT work when I have opened the spreadsheet from an Email attachment. At the top of Excel, there is a bar, which says "Protected View. This file originated as an email attachment and might be unsafe. Click for more details." Then there is a button the says "Enable Editing".
All I am doing is reading a cell... If the spreadsheet is "Protected View", then the code line above causes an AV.
How do I determine is I am in "Protected View" so I can give the user a Warning message?
Thanks
GS |
|
Andrei Smolin
Add-in Express team
Posts: 18830
Joined: 2006-05-11
|
Hello,
In Excel 2010, you need to check if ExcelApp.ActiveProtectedViewWindow <> nil.
Andrei Smolin
Add-in Express Team Leader |
|