+ Reply to Thread
Results 1 to 16 of 16

how to create unprotect shape

  1. #1
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    how to create unprotect shape

    Dear all,

    i have my workbook protected from editing.

    i need to create a shape with the below macro but i should instruct vba to create it as unlocked shape.
    this wll leave to the user the possibility to move it within the activesheet.
    can someone help?

    tks


    Please Login or Register  to view this content.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    dear shg

    tks but unfortunately still not working...

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    What does that mean?

  5. #5
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    Hi,
    When sheet is unprotected I can under the shape.
    As soon as I protect the sheet and then try to insert the shape I have a debug here:

    With ActiveSheet.Shapes.AddShape(msoShapeRectangle, 100, 100, H, b)
    .Locked = False

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    You have to unprotect the sheet, then insert the shape.

    Please Login or Register  to view this content.
    Last edited by shg; 04-07-2015 at 12:14 PM.

  7. #7
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    That is my problem , I need to keep everything protected except the shape that the user need to use..

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    That's what the .Locked = False line is for.

  9. #9
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    Ok i have tried that but still get the error ....do you think any other possibility ?

  10. #10
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    What error?

  11. #11
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    Error I meant debug ....I have try your code but I have same debug on that line I mentioned before unfortunately

  12. #12
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    Please post the exact code you're using, and say what line generates the error, and what the error message is.

  13. #13
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    hi,
    here the code, in red the line where i get the error :

    Please Login or Register  to view this content.
    the sistem says :

    run time error 1004
    the specified value is out of range

  14. #14
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    You have to unprotect the sheet at the top of the code, and then reprotect it at the bottom of the code, as shown in post #6.

  15. #15
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: how to create unprotect shape

    great.....thanks so much now works perfectly.

    many tks
    brgds
    Lorenzo

  16. #16
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: how to create unprotect shape

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically assigning a macro to a shape I create
    By vonRobbo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-18-2014, 10:04 AM
  2. Create a shape, and then placed in a macro
    By ssthree in forum PowerPoint Formatting & General
    Replies: 3
    Last Post: 07-07-2014, 11:32 AM
  3. VBA to create a shape based on L*W*H
    By michiganguy2000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-15-2013, 10:02 PM
  4. create macro which protect and unprotect all sheets
    By satyaveer.singh89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-15-2013, 12:01 AM
  5. How do I create a password to unprotect cells in Excel
    By rjbrelo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2006, 06:00 PM

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