+ Reply to Thread
Results 1 to 6 of 6

code is not locking workbooks..

  1. #1
    Forum Contributor
    Join Date
    01-27-2015
    Location
    New hampshire
    MS-Off Ver
    excel 2013
    Posts
    143

    code is not locking workbooks..

    what im trying to get happen in this code is after it copys the value into cell H13 in each workbook I want it to lock the sheet "measurements" in each workbook..
    but then it must unlock then the code is run again
    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,617

    Re: code is not locking workbooks..

    ThisWorkbook relates to the workbook with the code in it, not the Active Worrkbook, which is the workbook you have just opened.

    Use wbOPEN or ActiveWorkbook to refer to the workbook with the Measurements sheet in it. Preferably, wbOPEN to be consistent.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Contributor
    Join Date
    01-27-2015
    Location
    New hampshire
    MS-Off Ver
    excel 2013
    Posts
    143

    Re: code is not locking workbooks..

    I tried this and is still did not work

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    01-27-2015
    Location
    New hampshire
    MS-Off Ver
    excel 2013
    Posts
    143

    Re: code is not locking workbooks..

    any other ideas anybody?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,617

    Re: code is not locking workbooks..

    The .Protect in the original code is against the workbook, not the sheet. In the updated code, you don't have .Protect at all.

    Untested, but try:

    Please Login or Register  to view this content.

    Regards, TMS

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,617

    Re: code is not locking workbooks..

    Please don't bump your thread after 20 minutes. The people providing answers on this forum do so on a free and voluntary basis. Please be patient if the answer takes a little while. If you have not had an answer or an update after 24 hours, or so, THEN bump the thread.

+ 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. Locking Formula links from Other Workbooks
    By dkomin in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 08-08-2012, 04:24 PM
  2. [SOLVED] Locking the use of Macros from other Workbooks
    By Maudise in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-17-2012, 05:53 AM
  3. Locking and Unlocking Excel workbooks
    By KarmaPolice in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2007, 07:05 PM
  4. Shared Workbooks Locking Up
    By rastus in forum Excel General
    Replies: 0
    Last Post: 07-19-2005, 05:05 PM
  5. [SOLVED] locking workbooks
    By Nick in forum Excel General
    Replies: 0
    Last Post: 07-06-2005, 11:05 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