File Prompts To Unprotect Sheet With Password

May 8, 2009

In wrote a workbook in Excel 2003 that is causing me a problem I can not seem to figure out. The workbook consists of multiple worksheets that work using both VBA code or cell formulas. The worksheets are protected (though w/o a password) to prevent users from accidently altering a cell formula. When the code needs to write to a cell, it first unprotects the sheet, writes to the cell(s), and then reprotects the sheet.

Everything seems to work fine, often for several months. Then somehow something goes wrong. Specifically, after double-clicking on the ListBox in the worksheet “CRI Calculator” to pick a drug name, it will improperly present a dialog box (see attached screen capture 'Unprotect Sheet DialogBox.JPG') prompting the user for a password to unprotect the worksheet. Again, no password has ever been set; I have tried entering nothing, “password”, and "anonymous". Regardless of how you respond, an error code “Run-time error ‘1004’: The password you supplied is not correct…” occurs. If I press Debug, it takes me (ironically) to the following line of code

View 11 Replies


ADVERTISEMENT

Unprotect Password Protected File For Other Users

Aug 12, 2013

I have a master file that generates a new file every time the master user run the macro. The macro is pasted here:

Code:
Sub NewWorkbook()
'
ThisWorkbook.Unprotect ("Password01#")

[Code]....

I want the new file to be opening without asking for any password at all. What am I supposed to include in the code for that?

View 9 Replies View Related

Unprotect Sheet When Password Does Not Work

Oct 17, 2012

Is there a macro or other means to unprotect a sheet or workbook when the password is either forgotten or doesn't work?

View 1 Replies View Related

How To Unprotect Sheet When Password Is Forgotten

May 28, 2013

I have a file I use and forgot the pass for each sheet. The pass is the same for each sheet, but I cannot remember it. It is a .xlxs file.

View 1 Replies View Related

Unprotect Sheet - Remove Existing Password

Jan 22, 2014

I have a spreadsheet that cannot be modified. How do I remove the existing password? (I don't have the existing password).

View 1 Replies View Related

Forgotten Password To Unprotect Workbook/sheet

Feb 25, 2005

Is there a way to unprotect a workbook and/or worksheet in Excel 2002/2003 if
the original password is forgotten?

View 12 Replies View Related

Password Protected Sheet :: How To Unprotect A Sheet?

Jan 18, 2008

Does anyone know if there is a way to unprotect a sheet. The person who created this spreadsheet no longer works for our company and although we can see the spreadsheet, the formulas are hidden so we can't figure out where the data is being pulled in from. Any ideas?

View 9 Replies View Related

Macro To Unprotect Sheet Unlock Cells And Protect Worksheet With Same Password

Jan 23, 2012

I have been really trying to get this sorted myself and I can get it to work with one exception. I can't get the sheet to lock with a password. It locks, but if I try to unlock it again, it does so without prompting me to enter a password.

Essentially I am wanting to unprotect two sheets, unlock the cells that were previously locked (so users couldn't enter data in them when the sheet is protected), then reapply the same password to protect the sheet, but now they will be able to enter data in the unlocked range of cells).

The second macro is to reverse the changes made in the first and 're-lock' the unlocked cells) (and again apply the same password to the sheet).

this is the code I have used.

Sub PART_YEAR()

Sheets("2012 Calculator 1 week").Select
ActiveSheet.Unprotect "taado"
Range("D20:D23").Select
Selection.Locked = False
Selection.FormulaHidden = False
Sheets("2012 Calculator 2 week").Select

[Code]...

I am assuming I have superfluous code in there, in addition to my mistake with the reapplication of the password.

View 3 Replies View Related

Locked Project Prompts For Password

Nov 13, 2006

I have a workbook with extensive code of wich the VBE project is locked for viewing. Since i have distributed the workbook i had some users that gets prompt for a password when trying to run some code trough a button on a sheet. I have tried recreating this error by increasing the macro security level and unticking "trust access to vbe project" since i thought that is where the problem lies.

But i had no luck in recreating the error. I came accross some posts that had a similar error when you exit/close the workbook, wich was a problem with google desktop search being installed on the machine. Any ideas on why the user is being asked for a password ?, the code that should run does NOT try to alter/change anything in the code/project itself, so that shouldnt be the problem, but i can't think of anything else.

View 2 Replies View Related

How To UnProtect An Active Project With A Known Password

May 21, 2007

How to UnProtect an Active Project with a Known Password?

I have asked so many times in so many Excel Forums,

View 9 Replies View Related

Unprotect Worksheet Macro With Password

Dec 31, 2004

Here is my macro, how do I add the password to make it work properly?

Sub unprotect()
' unprotect Macro
' Macro recorded 12/30/2004 by '

ActiveSheet.unprotect
ActiveWorkbook.unprotect
End Sub

Both the sheet and the workbook are protected and use the same password

jiuk - code tags added

View 4 Replies View Related

Unprotect & Protect All Sheets With Password

Dec 21, 2006

I have a series of workbooks where multiple users are entering data. Most of the cells are locked, and the worksheets are password protected. From time to time, I have to make global changes to all the workbooks. I've recorded a macro to open all the workbooks, but now, I'm running into a problem because for speed, I'd like to unprotect the worksheets and "re-protect" them without having to enter the password 3 million times (exagerration, but not much). What is the proper syntax of code to have VBA enter the password automatically (it is the same for all sheets).

View 4 Replies View Related

Password Protect/Unprotect Dialog Macro??? !

Mar 4, 2007

Stumbling over syntax on what should be easy. I want to password protect the active sheet using plain vanilla user input box; and then unprotect ALSO via an input box. Doesn't matter about masking the input with **** or whatever. Based on responses below, here is macro code I used:

To protect the sheet:

Sub ProtectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Protect pword
End Sub
---------------------------------
To Unprotect the sheet:

Sub UnprotectSecurity()
Dim pword As String
pword = InputBox("Enter Password", "Password")
ActiveSheet.Unprotect pword
End Sub

View 5 Replies View Related

Protect And Unprotect All Sheets And Workbook Using Userform Interface And Password

Jul 6, 2012

I am trying to create a way to protect and unprotect all sheets and the worbook by means of a Userform pop up interface.

I have managed to create the Userform but what the code will look like and where to place the VBA code that will make it work, Also i would like to automatically save the sheet/s as i switch between them. so that any updates made to the sheet will be automatically saved when i move to the next sheet and also when i protect or close the workbook.

View 3 Replies View Related

Excel Macro That Prompts To Choose File To Hyperlink

Jun 12, 2014

I would like to write a macro that would insert a hyperlink to another file an would prompt the user to select the location of the file once the macro was run. I am not sure how I would get my macro to prompt the user to define the location (which is located on a network drive).

View 7 Replies View Related

Event Macro Causes Sheet Protection Prompts

Jan 26, 2007

One of the things it does throughout the course of the run is unprotect the worksheet, do what it needs to and then reprotects the sheet (using a password). On the second run, the sheet protection input box is shown and I am required to input the password before the code will execute.

The code that I have written uses an Add-in that pulls data from a database. As part of that retrieval, the other add-in protects the sheet without a password. Would that be causing my error?

View 6 Replies View Related

Workbook Sheet Change Event Prompts Save

Oct 28, 2009

I have many worksheets in a workbook that need to be saved if a user changesanything on them.
These sheet names all end in "....SD" and the code needs to only run on those sheets. I have learned alot from the forum but not enough, just yet . . This is what I have so far:

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim sht As Object
For Each sht In ThisWorkbook.Sheets
If LCase(Right(ws.Name, 2)) = "sd" Then
MsgBox(Prompt:="You must save changes. Save now?", Buttons:=vbYesNo) = vbYes Then ThisWorkbook.Save
End Sub

It doesn't like the 2 "Then's". (Don't laugh - I'm trying.)

View 8 Replies View Related

Password Protection :: Asking For Password Of An Old Deleted File

May 27, 2009

When opening a new Excel file, it is asking me for a password to an old excel file that was password protected, which I have deleted from my computer. It is still asking for this password every time I open a new or existing file. When I hit cancel it lets me open the file.

View 11 Replies View Related

Macro To Unprotect Sheet - Paste Then Protect Sheet

Apr 8, 2014

I want a sheet to copy and paste into another worksheet, I have that code and its working fine, but what I also want to do is for the sheet to be protected,so the code would be, copy, unlock, paste, lock, save.

Here is the code I have so far. I know i have to include ActiveSheet.Unprotect "passowrd" ActiveSheet.Protect "password", but I dont know where to include that last part of the code.

View 5 Replies View Related

Forgotten Password For Password Protected Sheet

Mar 21, 2007

I have a spreadsheet, which has certain worksheets that are password protected. I need to make changes to some of the formulas, and the VBA modules, however I cannot remember the password!! Is there a way of identifying the password??

View 3 Replies View Related

Unprotect The Sheet..

Feb 24, 2009

Spreadsheet was created by me and worksheets locked by me with password. Data is maintained by another on the network. Since acquiring a new PC with xl 2003 replacing 2000, none of the worksheets will allow me to unprotect. The "unprotect" menu option is not available (shaded out), and it says "shared" at the top.

I have numerous spreadsheets that work this way, but this is the only one that has this problem. How can I unprotect it to make modifications?

View 2 Replies View Related

Unprotect Sheet

May 3, 2007

I'm working with this workbook and suddenly the worksheets protected! Although I didn't make any password. I checked it but, I coulden't find any password. see code maybe there is a mistake.

View 7 Replies View Related

Protect / Unprotect Sheet

Jan 23, 2013

I am using the following code to protect/unprotect a sheet in a tool that i am working on, which seems to work great. It unprotects the sheet runs the code inbetween the two liens of code and then protects the sheet again.

VB:
ActiveSheet.Unprotect Password = "mypassword"
ActiveSheet.Protect Password = "mypassword"

The issue I am having is if i want to go in and edit the sheet without running the code it will not let me. When I go in and type the password to unprotect it says it is invalid. I have typed it exactly how the code reads. I have even tried including the quotes but no luck.

View 4 Replies View Related

Protect - Unprotect The Sheet

Jan 2, 2009

I have a worksheet where the users need to enter time. I have a macro that captures the time when the user hits Ctrl + t

What I want now is a code which protects the cell after entering the time with Ctrl + t.

I tried to do it, but my macro only works when I don't set any passwords to protect the sheet. How can I pass the password to the code and protect the sheet after the code to capture the time is being executed.

View 14 Replies View Related

Use Network Id To Unprotect Sheet

Jun 1, 2006

We have created a spreadsheet that needs to be protected as it is viewed by several users. We would like, if possible, to update this daily with as little human intervention as possible.

Can we use VBE and the on worksheet open event to unlock the password protection, update the sheet and then lock it again? I know that you can read who opens the sheet using code similar to the following but don't know whether the password protection can be "unlocked" utilising this method.

View 6 Replies View Related

Protect Or Unprotect Sheet By Various Users?

Jun 22, 2014

Is there is any way we can protect sheet in such a way that; if user - Mr. A inputs his password he can only go and is able to input his data in sheet 1.

I've a file which have multiple sheets say about 80 tabs are present. My colleague only works on one of the tab (sheet) enters data, that file is placed on our general sharing folder I want to know if it is possible that I can assign protection in such a way that when she enters her password she is able to input data only on the sheet in which she works and cannot roam around to other sheets?

Or is it possible that on first sheet there is username or password can appear? And if the data inputting person opens that file and enter her password option appear which can take her to that particular sheet? And if a guest open that file he/she can only view particular sheets which contain reports?

View 1 Replies View Related

Password Protect: Unlock The Worksheet, Autofilter It, Print It, Unfilter It, And Password Protect The Sheet Again?

Jan 12, 2007

I have a sheet that is password protected. I have this code attached to a command button. It will unlock the worksheet, autofilter it, print it, unfilter it, and password protect the sheet again. However it is protecting it without a password. I need to have it protected with the password so that someone will not be able to just go to tools to unprotect the sheet.

Private Sub CommandButton1_Click()
ActiveSheet.Unprotect "rainforest"
Columns("O:O").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:=">0", Operator:=xlAnd
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Selection.AutoFilter Field:=1
Selection.AutoFilter
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End Sub

View 3 Replies View Related

DAO Query On Password Protected File: Could Not Decrypt File

Dec 9, 2006

I have an existing application that uses DAO sql queries to populate a form. It has always worked fine. Earlier this week, I password protected the spreadsheet. Now my DAO query fails. I get a run-time error '3161'. Could not decrypt file.

' Const stExtens As String = "Excel 8.0;HDR=Yes;"
Const stExtens As String = "Excel 8.0;HDR=Yes;PWD=money16;"

Private Sub Execute_Query(SQL)
'Instantiate the DAO objects.
strDb = ThisWorkbook.FullName
Set DAO_ws = DBEngine.Workspaces(0)
' code fails on the line below
Set DAO_db = DAO_ws.OpenDatabase(strDb, False, True, stExtens)
Set DAO_rs = DAO_db.OpenRecordset(SQL, dbOpenForwardOnly)
End Sub

View 3 Replies View Related

Adding Unprotect Sheet Command To VBA Code?

Aug 22, 2012

Workbook performs perfectly 95% of the time but every now and again I have this issue where the formular do not calculate (it is set to automatic).

I have a workaround of doing a find and replace across all the worksheets of "=" replaced with "=" and this solves the issue.

The problem I am having is that some of the sheets are protected and some are not. The code I am using for the find and replace is as follows...

VB:
Option Explicit
Sub ChgInfo()

Dim WS As Worksheet
Dim Search As String
Dim Replacement As String

[Code] .....

I need to add to this code the unprotect command and then reprotect only the originally protected sheets?

I am sure these is a better way of doing this but im really short on time. This issue only occurs 5% of the time. the other 95% the formula all calculate fine!

I just need a way of doing the find and replace for = to = across all sheets in the workbook regardless of the sheet protection!!

View 1 Replies View Related

Unprotect/Reprotect Sheet During Email Vba Code

Nov 18, 2009

I have an email vba code set up in my workbook that emails the worksheet in an attachment to someone. However, I keep getting an error code saying permission denied when the code tries to finish. It highlights the "Kill Tempfile" field...which in my mind is saying permission denied because I have the worksheet password protected. I kind of want to keep it that way, so is there a way I can enter a line of code in my current script to unprotect what is being emailed in the beginning of the code so that the tempfile created when it is being emailed can be deleted?

Here is my current
PHP
Private Sub CommandButton1_Click()If Len(Range("H59")) = 0 Or Len(Range("H61")) = 0 Then    MsgBox "Please enter customer/employee submitting request and click SUBMIT again."    Exit SubElse'   Enter the rest of your code hereActiveSheet.PageSetup.BlackAndWhite = TrueApplication.Dialogs(xlDialogPrint).ShowSet appWrd = CreateObject("Word.Application")Set docOpen = appWrd.Documents.Open("F:groupsdeptservCDTISA.doc")docOpen.PrintOutdocOpen.CloseappWrd.QuitDim FileExtStr As String    Dim FileFormatNum As Long    Dim Sourcewb As Workbook    Dim Destwb As Workbook    Dim TempFilePath As String 

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved