+ Reply to Thread
Results 1 to 2 of 2

Macro to lock multiple workbooks or open worksheets

  1. #1
    Registered User
    Join Date
    08-14-2014
    Location
    kuwait
    MS-Off Ver
    Excel 2010
    Posts
    1

    Post Macro to lock multiple workbooks or open worksheets

    Hello

    This is my first post, I have multiple workbooks, some of which contain multiple worksheet, I am locking the worksheets by using the following macro:

    Sub ProtectAll()
    Dim wSheet As Worksheet
    Dim Pwd As String
    Pwd = InputBox("Enter your password to protect all worksheets", "Password Input")
    For Each wSheet In Worksheets
    wSheet.Protect Password:=Pwd, DrawingObjects:=True, Contents:=True, Scenarios:=True, _
    AllowFormattingColumns:=True, AllowFormattingRows:=True
    Next wSheet
    End Sub

    However, my question is can I use it to lock multiple workbooks that are open in excel?

    Please help me....I have over 1000 workbooks to lock ....

    Thanks

    Andy

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Macro to lock multiple workbooks or open worksheets

    Unfortunately your post does not conform to rule #3.


    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button). The result will appear like this in the post window:

    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]

    ... and appear like this when posted:


    Please Login or Register  to view this content.
    To correct, please click the 'Edit Post' button below.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ 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. Replies: 2
    Last Post: 02-28-2013, 11:39 AM
  2. [SOLVED] Run Macro on Multiple OPEN Workbooks
    By DrEcosse in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2012, 09:22 PM
  3. Copy Data From Multiple Open Workbooks to Another Workbook with Separate Worksheets
    By lupitenis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-23-2012, 05:36 PM
  4. macro to open multiple workbooks at once
    By easty in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-30-2010, 08:48 PM
  5. [SOLVED] macro or code to open multiple workbooks
    By Duane Reynolds in forum Excel General
    Replies: 1
    Last Post: 03-14-2006, 04:25 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