PDA

View Full Version : On editing protected view programmatically , display setting are getting changed .



ankur_ss
12-05-2019, 05:38 AM
When I call ProtectedViewWindow.Edit in ProtectedViewWindowOpen event for excel, document gets open successfully without protected view but all settings under options-> Advanced -> "Display options for workbook" are getting unchecked automatically.

Example:

Show sheets tabs, show vertical scroll bar and show horizontal scroll bar was checked before placing file on network drive.

After copying same file over network drive and opening it, ProtectedViewWindowOpen event gets triggered and since we have called ProtectedViewWindow.Edit in that event, document gets open successfully without protected view (Expected Behavior).

But after ProtectedViewWindow.Edit call vertical scroll bar, horizontal scroll bar and sheets tab are missing. That is all the setting under options-> Advanced -> "Display options for workbook" are getting unchecked automatically. Although there is no change in modification date / time of document. These settings doesn't get change on manually clicking on Enable Editing button, it only happens on calling ProtectedViewWindow.Edit.

Is there any way to edit protected view window programmatically without changing the display option of workbook?

Bob Phillips
12-05-2019, 05:44 AM
I am not aware of this problem, but couldn't you save those settings beforehand, and restore them afterwards?

ankur_ss
12-05-2019, 11:30 PM
I am not aware of this problem, but couldn't you save those settings beforehand, and restore them afterwards?
I am not able to find any interface / object model which represent all setting under "display options for this workbook".