+ Reply to Thread
Results 1 to 5 of 5

Apply Macro First UnprotectSheet After Apply Macro ProtectAgain Solved by : Sixthsense

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,011

    Thumbs up Apply Macro First UnprotectSheet After Apply Macro ProtectAgain Solved by : Sixthsense

    Hello evryone

    i using this code to filter but
    when my sheet is protect there is an debug ( U can't use this command in protect mode first Unprotect then apply command )

    i want when i apply this code first unprotect my sheet then after applying code protect again


    Please Login or Register  to view this content.
    thanx a lot
    Last edited by HaroonSid; 04-02-2014 at 05:32 AM. Reason: solved

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,771

    Re: When Apply Macro First UnprotectSheet After Apply Macro ProtectAgain

    Try like this...

    In the below code change the Abc to your sheet password

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,011

    Re: When Apply Macro First UnprotectSheet After Apply Macro ProtectAgain

    yeh!

    worked fine as i wanted thaxn a lot frnd

    BestRegards
    haroon2015

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: When Apply Macro First UnprotectSheet After Apply Macro ProtectAgain

    You could protect the sheet using the UserInterfaceOnly parameter of the PROTECT method - that allows code to modify the sheet but locks out interactive changes by the user...

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,771

    Re: When Apply Macro First UnprotectSheet After Apply Macro ProtectAgain

    Hi cytop,

    That UserInterFaceOnly method will be lost from excel memory once the file is closed and reopened.

    It should be re-protected on each time at workbook_open event by enabling the UserInterFaceOnly.

+ 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. [SOLVED] Macro that can apply a specific Macro to all sheets except first
    By Haidar123 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-01-2014, 10:56 AM
  2. Apply macro to all sheets
    By Costasg in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-03-2011, 01:09 PM
  3. Macro Help - Trying to apply macro to multiple tabs
    By cvar1980 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-30-2010, 02:05 PM
  4. Apply macro between tabs
    By mrsogmax76 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2009, 10:53 AM
  5. Macro apply to next row
    By EF_Topcat in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-12-2009, 09:21 AM

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