Results 1 to 6 of 6

Thread: Set "Access content programmatically" checkbox with vba

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0

    Set "Access content programmatically" checkbox with vba

    Hello,

    I am trying to set the "Access content programmatically" checkbox to true within the permissions setting as in:
    How to: Permit Code to Run Behind Documents with Restricted Permissions

    I have found the msoPermissionObjModel option for adding individual users, but when I set this using

    Code:
    ActiveWorkbook.Permission.Add UserName, MsoPermission.msoPermissionObjModel
    the box is not checked.

    Is there a way to grant these permissions universally?

    Thank you

  2. #2
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    You might only be able to do that if you have administrative privileges. Are you able to manually do this?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  3. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    Quote Originally Posted by Excel Fox View Post
    You might only be able to do that if you have administrative privileges. Are you able to manually do this?
    I do. In the macro, I've just created the file, and am able to manually do this after the macro is completed.

  4. #4
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    I'm not actually sure if this is possible now. I tried to record a macro of me changing it, and the source was blank.

    Does that mean it's not possible?

  5. #5
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,401
    Rep Power
    10
    So is this something related to accessing an Excel file that is saved in a SharePoint portal? Where exactly are you checking / un-checking this checkbox?
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  6. #6
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Rep Power
    0
    Quote Originally Posted by Excel Fox View Post
    So is this something related to accessing an Excel file that is saved in a SharePoint portal? Where exactly are you checking / un-checking this checkbox?
    It's being emailed around, but we're using the MSFT id's for setting access permissions (Windows Rights Management must be installed).

    File->Info->Permissions->Restrict Permissions by People->More Options : "Access Content Programmatically"

    this option used to be checked when we set permissions, and now something has changed and it is not. Would like to actually set it so that we have control and it doesn't change "randomly" as it appears to be doing now

Similar Threads

  1. VBA Versions of my "Get Field" and "Get Reverse Field" formulas
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 4
    Last Post: 06-02-2017, 06:15 PM
  2. Reversing a "First Middle Last" Name to "Last, First Middle" Name Format
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 5
    Last Post: 01-06-2014, 10:04 PM
  3. VBA to avoid - "indirect" Formula
    By leopaulc in forum Excel Help
    Replies: 2
    Last Post: 10-23-2012, 05:01 PM
  4. Follow-up to "Excel Number Format: Indian Style Comma Separation"
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 2
    Last Post: 04-14-2012, 10:46 PM
  5. Ordinal Suffix (i.e., "st", "nd", "rd" and "th")
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 0
    Last Post: 03-20-2012, 03:46 AM

Posting Permissions

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