+ Reply to Thread
Results 1 to 8 of 8

Protect all objects in visible sheets

  1. #1
    Registered User
    Join Date
    02-11-2008
    Posts
    68

    Protect all objects in visible sheets

    Hello,

    Could someone suggest some VBA code to protect all objects in visible sheets?

    Are charts included in the objects collection?

    thanks
    tasos

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Yes I think charts are included as objects.

    What version of excel?

    Have you tried using the macro recorder whilst applying sheet protection?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    02-11-2008
    Posts
    68
    Hi,

    i am using excel 2007.. I wasn't able to use the macro recorder to protect objects.. I think this can only be done via VBA.

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    The macro recorder gave me this when protecting the sheet

    Please Login or Register  to view this content.
    This will lock all the shapes/objects on the activesheet
    Please Login or Register  to view this content.
    To get at the dialog to format a shape manually select it
    Drawing Tools > Format > Size > dialog launch (small arrow bottom right corner of group)

  5. #5
    Registered User
    Join Date
    02-11-2008
    Posts
    68
    thanks Andy

    are graphs included within the shapes collection?

    I am still a bit confused.

    I need two separate procedures:

    - One to protect only the charts for all sheets

    - One to protect all objects for all sheets

    thanks again for all your help

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,441
    Yes chartobjects are part of the shapes collection.

    To get just chart objects then this for each loop

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-11-2008
    Posts
    68
    ok, this is the reason i am confused..

    I have some charts with data tables and I use your procedures and they still are not protected... they can be moved around and changed.

    I am using Excel 2007.

    thanks
    andy

  8. #8
    Registered User
    Join Date
    02-11-2008
    Posts
    68
    my bad... its now working as expected... thanks for your help Andy :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1