+ Reply to Thread
Results 1 to 5 of 5

VBA To Open A Password Protected Worksheet

  1. #1
    Registered User
    Join Date
    10-13-2014
    Location
    Penang, Malaysia
    MS-Off Ver
    2010
    Posts
    6

    VBA To Open A Password Protected Worksheet

    I have 2 files. Worksheet A and Worksheet B. Worksheet A is protected by password but have some data that is linked to Worksheet B. How do I enable Worksheet B have the data updated without manually key in the password which is prompted every time when I open Worksheet B? Please guide me where to place the code. ThisWorkbook? Sheet? Class Module? Module?
    Last edited by DummYBeaR; 10-15-2014 at 01:56 AM. Reason: Workbook amend to Worksheet

  2. #2
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: VBA To Open A Password Protected Workbook

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-13-2014
    Location
    Penang, Malaysia
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA To Open A Password Protected Workbook

    Where should I put this code? By the way, does the sheets code apply same for workbook & worksheet as well?

  4. #4
    Forum Contributor
    Join Date
    04-12-2013
    Location
    Usually at work, in the UK
    MS-Off Ver
    Excel 2010
    Posts
    639

    Re: VBA To Open A Password Protected Worksheet

    Oh workbook might be a bit different. You'll have to declare the filepath as a variable and then the sheet range. I think it should look something like the below code.

    Add the Unprotect before and code and then Protect after the code that way the sheet will be unlocked before the code is run and then locked when the code has finished.

    Please Login or Register  to view this content.
    Last edited by Sc0tt1e; 10-15-2014 at 02:13 AM.

  5. #5
    Registered User
    Join Date
    10-13-2014
    Location
    Penang, Malaysia
    MS-Off Ver
    2010
    Posts
    6

    Re: VBA To Open A Password Protected Worksheet

    I'm confuse now Maybe I did not get my question asked correctly. Here is the problem again with better explanation.

    I have 2 files.

    File A as Master & is protected by password if were to open
    File B as Secondary which is getting part of data from File A

    Every time when I open File B, a window will appear & request for password to access File A. I have to manually key in the password to get the data updated. If I disable File A password protection, opening File B will not have any problem updating the data. No window will prompt requesting for password.

+ 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. VBA to open a password protected workbook
    By Larry.LeBlanc@O in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-07-2016, 11:02 AM
  2. Open, copy and save to password protected workbook
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-27-2013, 11:46 AM
  3. [SOLVED] Password array to open all password protected workbook in a folder
    By rename in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-07-2012, 05:06 AM
  4. [SOLVED] Open workbook that is password protected for modifying + VBA + VBS
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2012, 02:15 AM
  5. vba macro open password protected workbook
    By Ray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2006, 11:15 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