The Unlock Button Gives An Error

May 15, 2008

I have an lock button to lock a worksheet, and a unlock button to unlock the same worksheet.
The unlock button though gives me an error when I don t set the password correct or not at all.
My code is like that

Sub UnlockSheet()
'
' Unlock Sheet Makro
'
'
ActiveSheet.Unprotect
End Sub

I am sure that is very simple for you guys here but for me a problem I can not figure out yet why.

View 9 Replies


ADVERTISEMENT

Unlock A Cell With A Button

Mar 19, 2009

I want to let the user unlock certain cells but only after they have clicked a button. To notify that the cell is unlocked I also want it to change colour.
Is this possible?

I have attached a small example. Password is mg

unlock.xlsx

View 6 Replies View Related

Button To Unlock & Unhide All Columns

Apr 14, 2008

I have a sheet that upon opening a macro runs to hide a selection of columns based on cell containing certain words (see here).

I now also require the workbook to be protected so that the hidden columns (which Im sure are locked as default when hidden) are locked as are columns N & S. Now, I know I can do this by protecting the sheet and unprotecting the columns I require (ie N & S - with the hidden cells remaining locked anyway).

The issue is, every time the workbook is opened this protection must be in place.

However, I require a button, which could simply reside in A1, that when pressed, will unhide and unlocked all cells. - This is needed as its vital I can easily copy rows to another sheet (and delete from existing sheet) as and when required.

if possible, re-pressing the button would hide and proetct the worksheet however this is not too significant as long as when I close and open the workbook everything is hidden and protected as specified above.

There is no need to password protect anything.

View 9 Replies View Related

Protect Worksheet Automatically & Unlock All Error Cells

Nov 24, 2007

I would like a <worksheet> to be automatically locked if all the data entered is acceptable, I would also like a message box to come up saying this. But I would like to be able to edit the data with a message box coming up to warn that I am about to change the data.

View 4 Replies View Related

Error "information Specific To The Error Type" Checking Options Button

Feb 9, 2007

I have a relatively simple, though large, spreadsheet. I get the following in many of my cells: The Error Checking Options button is displayed and the cell itself. is marked with a small green triangle in the upper-left corner. When I click the button, the error type is displayed, followed by the following list of error-checking options:

information specific to the error type

• Show Calculation Steps: demonstrates all steps leading to the error
• Ignore Error: allows you to accept the formula as entered, without Excel displaying the Error Checking Options smart tag
• Edit in Formula Bar: allows you to edit the formula that is generating the error in the Formula Bar
• Error Checking Options: opens the Options dialog box, where you can select the rules governing error checking
• Show Formula Auditing Toolbar: displays the Formula Auditing toolbar

When I check the formula it calculates correctly. What triggers this when there is no error, is there a way to prevent it from appearing in the worksheet?

View 2 Replies View Related

Error When Put Macro Into Toggle Button

Nov 4, 2011

ToggleButton? I have made this Macro work

Sub group()
'
Dim i As Integer

Sheets("Operating Income Trending (LOC)").Select
For i = 53 To 2 Step -1
If Cells(7, i) = "" Then
Sheets("Operating Income Trending (LOC)").Columns(i).EntireColumn.Hidden = True

End If
Next i
End Sub

And when i tried to put it into a togglebutton like below:

Private Sub ToggleButton1_Click()
Select Case ToggleButton1.Caption
Case "Group"

Dim i As Integer

Sheets("Operating Income Trending (LOC)").Select

[Code] .........

Then instead of hiding all the blank columns, it hides almost all the columns, leaving some that are supposed to hide. i could not figure out why as it worked fine as individual macro.

View 2 Replies View Related

400 Error When Excel Close Button Is Pressed

Jan 10, 2014

Why I receive a 400 error when the 'excel close' button is pressed in the attached sample.

View 2 Replies View Related

Error On Button Code Reference To A Subroutine

Mar 2, 2007

I'm having trouble calling a subroutine from a command button. It's puzzling because I've set up buttons before and didn't have this trouble.

Here is my button
Private Sub EPConversionButton1_Click(ByVal target As Range)
Convert_Hrs_EP target
End Sub
And here is the subroutine.

Sub Convert_Hrs_EP(target As Range)
End Sub
There's nothing there yet, but I keep getting error messages regarding the transfer from the button code to the subroutine.

The message is: Procedure declaration does not match description of event or procedure having the same name. The Help file says this means that my procedure has the same name as an event, but does not have the same signature. But it's not so.

View 9 Replies View Related

Error Code 400 When Creating Button For MapPoint

Aug 2, 2006

I am creating an excel file that has 2 buttons:

-1 that allows the user to select an image (works)
-1 that allows the user to select a MapPoint Map file (error 400)

The code below should be able to detail the problem.

Sub InsertImageOne()

Range("b5").Select
Application. ScreenUpdating = False

Picture1 = Application. GetOpenFilename("Picture,*.JPG,Picture,*.JPEG,Picture,*.GIF,Picture,*.BMP")

ActiveSheet.Pictures.Insert(Picture1).Select
Selection.ShapeRange.LockAspectRatio = False
Selection.ShapeRange.Height = 205
Selection.ShapeRange.Width = 344
Application.ScreenUpdating = True

End Sub

View 4 Replies View Related

Control Button Error :: Suppose To Call A Userform

Dec 27, 2007

I have a control button on a worksheet that is suppose to call a userform. I am using the code

Frm_Customs.show

But I keep getting an error. The button was created from the control toolbox.

View 9 Replies View Related

Vb Yes No Error: Click 'Yes' Button It Closes The File Without Saving?

Jun 20, 2007

This code appears to do opposite of what I intended i.e., when I click 'Yes' button it closes the file without saving; and when I click 'No' button it closes the file with saving?

Private Sub btnExitNewPipes_Click()
If MsgBox("Save the Data?", vbYesNo + vbQuestion, "File Save") = vbYes _
Then ActiveWorkbook.Close SaveChanges = True
ActiveWorkbook.Close SaveChanges = False
End Sub

View 7 Replies View Related

Getting An Error Message Of Object Reuired When I Click On The Form Button

Oct 29, 2008

I have attached my excel database, as think I'm having a funny moment, I keep getting an error message of Object Reuired when I click on the form button to launch the Input Form, where have I gone wrong as to why the Input form will not load?

View 5 Replies View Related

Crashes On UserForm Show By Next Button (Path/File Error)

Aug 7, 2008

When loading my workbook, my userform loads perfect, but when I go to hit the "next" button. It crashes with the error:

"Path/File access error."

The next button code, quite simple: ....

View 9 Replies View Related

Run Time Error 1004 When Selecting Range On Another Sheet Using A Command Button

Nov 20, 2009

Run Time Error 1004 when selecting range on another sheet using a command button. I have created a command button that plays the following macro.

View 2 Replies View Related

Excel 2010 :: Automation Error When Click On Button That Executes Macro

Aug 22, 2012

I keep getting an automation error in excel 2010 when I click on the button that executes the macro. Excel crashes when the box appears. There is no code in the error box. Why I get this error message.

View 2 Replies View Related

Excel 2007 :: Runtime Error 1004 - Select Method Of Button Class Failed

Sep 26, 2013

My excel version is 2007 and i am on WIN7 64bit

I have a workbook with VBA which was working fine earlier. Lately i have been getting

"Runtime error 1004" Select method of button class failed.

I am adding buttons dynamically in a loop in a sheet and what surprise me is , i go to debug mode when error pops up and it points to below line

MySheet.Buttons.Add(ActiveCell.Left - 5, 25, 20).Select

but my code is running in a loop and i can see that atleast 20 buttons were added and it fails to select when it try to add this iteration. It is completely confusing me.

My entire below code is in a loop

Code:
maWrk.Cells(xIt1, yIt2).Select
mySheet.Buttons.Add(ActiveCell.Left - 5, 25, 20).Select
Selection.OnAction = "callMe"

[Code]....

I also notice that when it fails, on select method .. the button was actually added to the sheet with caption/name as "Button 65536" but then fails to select it. What makes the select to fail after adding the button? Could there be anything special with Button 65536?

Is there any better way to code the adding button and setting action and name for excel 2007?

note before entering the loop i am deleting all the shapes with myShape.Delete which name matches "btRun"

I also want to highlight that i don't have 65536 rows in my sheet. I just have 200 rows. and when this error happens it is on row 150 so firstly i wonder why it is naming the button as Button 65536. I would assume it will start with 1 and go on increments.

What makes excel to fail to select an added button in VBA?

View 6 Replies View Related

Unlock Vbaproject

Sep 27, 2006

I have a file where I can not enter the VBAProject. If I click on it I get an error message and when I try to get into the Properties of the Project I get the same Message. The error message is "Project locked" (in german). I locked the file my self some month age, all passwords are saved but i am not asked to enter one. I think that i can remeber I was writing a macro in a nother file that locked and unlocked this specific file.

View 3 Replies View Related

Unlock File

Apr 23, 2007

I have a shared file that is now mysteriously locked. How can I unlock the file so changes can be made?

View 4 Replies View Related

Unlock Cells For A Particular Month?

Nov 8, 2013

After going through some posts in this site, I found that, we can use custom validation for locking a cells when the condition is not met.I have tried using that, But I am not able to get it correctly.I have attached the sheet for your ref.

What I want is, when I enter a month in A2 (Which will always be the 1st of that month), that particular column should get unlocked/should be able to edit that month's column only. I have just provided on table here, but what I want is for entire column so that, I can use the same formula for a larger sheet

View 3 Replies View Related

Unlock Cell Using Code

Mar 6, 2009

code that will unlock cell g12 and af9 when cell e9 equals "WF-"

Basically I need it to say (I really don't know how to write code)
If "E9"="WF-" unlock "G12" and "AF12"
If not, clear contents of "G12" and "AF12"

View 11 Replies View Related

Programmatically Lock/unlock Vba

Aug 7, 2007

Is it possible to lock/unlock the VBA code in a workbook through VBA from another workbook? I wish to copy modules from one workbook to another, both workbooks will have the VBA code password protected to stop prying eyes. Obviously I need to unlock the VBA in the target workbook before the copy and lock it again afterwards. Can this be done programatically? If there is no function in VBA to do this can you provide an example of how to do it using SendKeys if that is the only way to do it?

View 3 Replies View Related

How To Unlock Worksheet (Password Protected)

Sep 13, 2013

What if you forgot the password in a protected sheet? is there a way to unlock it?

View 1 Replies View Related

Unlock Sheet On Cell Selection?

Jul 4, 2014

I have a table and need to protect the sheet. From searching I see its a common problem as the table wont auto expand on a protected sheet.

I was thinking maybe I could create some sort of change event so if a user selects cells on Column A,B,G,H rows 13-1000 the sheet will auto unlock then lock again once they leave those cells.

I think it may need a few seconds delay to give table chance to autoexpand before sheet is locked again.

View 3 Replies View Related

VBA Locked And Unable To Even Get To A Place To Unlock?

Jul 30, 2014

Some how my spread sheet became shared and has been locked. so when I went to use my VBA to unlock the sheet i found my project locked as well and no way to get to properties to try and unlock.

View 3 Replies View Related

VBA Code To Unlock Multiple Sheets

Oct 4, 2007

How I can unlock a range of sheets that are password protected in my workbook.

I have 20 identical sheets one for each department which are protected by the same password.

It would be nice if I could rapidly lock and unlock these sheets.

What I need a set rng command in conjunction with a For Next loop?

View 12 Replies View Related

Unlock Columns If Column Is Not Blank In Any Row

Jan 30, 2009

Unlock columns if Column is not blank in any row

Using VBA
On Sheet("Draft Final") , search every row and

If Col A is not blank, then unlock Columns G: M and unlock Columns O:U

View 4 Replies View Related

File Locked For Editing - How To Unlock

Mar 15, 2012

I am getting a message, the Excel file i am opening (xlsm) is locked for editing by 'another user'. But, NOT SO, of course; i am the only user logged in to this PC, and there is no network access. I quit Excel and verified that i see no Excel processes running. But, when i try to open the file, i still get the "locked by 'another user'" message, and at this point can only open read-only. I looked in the folder the file is in and do not see any of those ~ files or anything else suspicious.

So, what do i do? How do i "unlock"? How can i open this file once again to make modifications to it?

View 7 Replies View Related

Lock / Unlock Spreadsheet Userform

Sep 13, 2012

I have the unlock/lock code below but i cannot get it to unlock the correct spreadsheet. Where do i need to place it in the code so that it will work properly.

Code to unlock:

Public Sub unlocksheet()
'unlock the worksheet
On Error Resume Next
ActiveSheet.Unprotect Password:="test"

Within this code:

Private Sub cmdSub_Click()
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("AFW")
'find first empty row in database

[Code] .........

View 1 Replies View Related

Unlock Cell Range If Row Is Blank

Nov 9, 2012

I have a worksheet with active range A9 thru K200 that is locked. When worksheet is opened, I need it to automatically unlock all rows that are blank, for users to input data. It would be great if this could also require data in column A, C and K before allowing workbook to be saved and closed.

View 2 Replies View Related

Code To Unlock Password Not Working

Apr 4, 2014

I have a workbook whose worksheets I want to protect on open, and also want to unprotect by way of a module. The protect code is:

Code:
Private Sub Workbook_Open()
Sheets("Cornealrings").Protect Password:="elohim"
Sheets("Ferrararings").Protect Password:="elohim"
Sheets("Kera Rings").Protect Password:="elohim"
Sheets("IS CALCULATOR").Protect Password:="elohim"
Sheets("IS Manager").Protect Password:="elohim"
End Sub

The unprotect code is:

Code:
Sub Unprotect()
Sheets("Cornealrings").Unprotect Password:="elohim"
Sheets("Ferrararings").Unprotect Password:="elohim"
Sheets("Kera Rings").Unprotect Password:="elohim"
Sheets("IS CALCULATOR").Unprotect Password:="elohim"
Sheets("IS Manager").Unprotect Password:="elohim"
End Sub

The code stops at the first line of the unprotect event, with the message that the password is not correct. If I try to manually unprotect, the password is accepted.

View 7 Replies View Related







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