Consulting

Results 1 to 3 of 3

Thread: On editing protected view programmatically , display setting are getting changed .

  1. #1
    VBAX Newbie
    Joined
    Dec 2019
    Posts
    2
    Location

    On editing protected view programmatically , display setting are getting changed .

    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?

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I am not aware of this problem, but couldn't you save those settings beforehand, and restore them afterwards?
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Newbie
    Joined
    Dec 2019
    Posts
    2
    Location
    Quote Originally Posted by xld View Post
    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".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •