Results 1 to 5 of 5

Trouble unhiding a password protected worksheet in excel 2010 vba

Threaded View

  1. #1
    Forum Contributor
    Join Date
    10-07-2011
    Location
    Plano, TX USA
    MS-Off Ver
    Excel 2013
    Posts
    141

    Trouble unhiding a password protected worksheet in excel 2010 vba

    Hi Everyone -
    I have a Workbook with several Hidden Worksheets. All of the Worksheets are password protected.

    Problem - I want to copy data from a visible worksheet to a hidden worksheet. I am using the following code:

       pwd = "Test"
        Sheets("Summary").Select ' << Visible Worksheet
        Range("E8:AS454").Select
        Selection.Copy
        Sh = "Summary Export" ' << Hidden Worksheet
        Sheets(Sh).Unprotect Password:=pwd
        Sheets(Sh).Visible = xlSheetVisible '  <<<<<  BLOWS UP HERE
        
        Sheets("Summary Export").Select
        Range("D5").Select
    
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
    I get Run-time Error 1004 - Unable to set the Visible Proerty of the Worksheet

    Any help is greatly appreciated

    Jim
    Last edited by stubbsj; 05-16-2012 at 08:20 AM. Reason: left something out

Thread Information

Users Browsing this Thread

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

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