Close Window

Vba Password Crack/hack - How Easy Is It?

Hi everyone,

Ok, so I'm a little cheezed that I've been volun-told to give up an economic model that took me over 8 months to develop to a few investment bankers that will likely sell it to the highest bidder. Of course, with no credit to me.

I've already taken a few of the necessary steps to lock it down.

- Lock/hidden cells along with sheet protection (with password) - to prevent viewers from seeing the formulas I used.
- protect workbook (with password) - to prevent copy/paste of the sheets
- VBA - Tools - VBA Project Properties - Protection - Set password - to prevent viewing of the macros
- Hiding sheets using "Very Hidden" in VBA - to prevent viewing of sheets in general.

I guess my real question is, when this is all said and done, how easy is it for someone to break through all the passwords that I've set up in the workbook? If it's ridiculously easy, how do I prevent it (if at all)? What else can I do?

Thanks for the input.


Free Excel Courses

Similar Excel Tutorials

How to keep an Excel workbook safe by encrypting it with a password. This will make it so that a user cannot open t ...

How to password protect VBA code and macros in Excel so that a user cannot see the code or edit it or do anything ...

I'll show you how to lock a spreadsheet so that nothing can be changed in it. This is a great feature to use when ...

How to allow only certain people to edit certain cells or ranges in Excel. This is a security feature that you can ...

Helpful Excel Macros

- This macro will hide all formulas within a workbook and not allow them to be deleted. The page will not be protected li

- This will allow you to protect or unprotct all worksheets in a workbook at once. It doesn't allow you to input a passwor

- This Excel Macro allows you to save a specific worksheet within the Excel Workbook to its own new file. You will be a

- This is the ultimate Lookup Macro for Excel. It will search every worksheet in the workbook and return all of the mat

- Delete all chart sheets and tabs in Excel using this macro. This will only delete the charts and graphs that are in the

Similar Topics

I have a Workbook with 2 sheets, the first one is the data entry and the second one contains all the calculations and confidential info.
I have one staff member that does the data entry but I don't want them to see the 2nd sheet. I know I can hide the sheet then protect the entire workbook which does work, but is there an easier way so that the second person doesn't have to keep hiding/unhiding the 2nd sheet?
It would be perfect if when you tried to click on Sheet2, it asked for a password.

We have a large (4,000+ rows) excel worksheet from a prior employee that I
would like to be able to use, but it is password protected and no one has the
password. Is there a way to copy or save it as a different file that will
not copy the password protection? It would save me a couple days of work if
it is possible.


I need to open a password protected workbook using VBA.

I've tried the code below but I still get prompted for a password.


Workbooks.Open Filename:="\\HOME\Working\Report.xls" _
, Password:="xxxx"

How do I get it to open automatically???

Why do I sometimes get extra blank pages from the printer on Word or Excel
documents? How can I prevent this?

I saw two threads in this forum that asked this question, with no good answer. I am posting this solution for anybody still struggling with this.

The question:
How can you prevent a cell's contents from overflowing into the next cell?

Of course, you can make the column wider or turn on text wrapping, but you might not want to. Each of those solutions can mess up the layout of your sheet. You may just want to truncate the value.

Some people have suggested putting a space in the next cell. This is unnecessary, a pain in the but, and will mess up any ISBLANK type formulas, among other things.

The solution:
Select the cells in question and turn on text wrapping (Format>Cells>Alignment>Wrap Text).
Now select the row(s) in question and manually set the row height, by right clicking the row number and selecting "Row Height". Check the height of an adjacent row for a good value.

Your cells will now not spill over either horizontally or vertically. They will simply truncate anything that doesn't fit.

Be careful now, because parts of your data may be hidden. This can cause its own set of problems if one or two digits are neatly hidden away. Think ahead if other people might be using this sheet, and not be expecting to have some data hidden.

Tested in Excel 2002

Corporate edict.

I have a worksheet that is locked and protected now, except for cells in a certain collumn. I have named the cells in that column "MS96A".

If a user enters a date in a cell or range of cells anywhere in the column, the changed cells also need to be locked and protected (Once they enter a date, it is not allowed EVER to be changed again. Corporate requirement! *Shrug*).

What I am looking for is this. If the user selects that cell again, they will get the usual pop-up message, "The cell or chart that you are trying to change is protected..."

I think I am close, but I am getting an "End If without block If" error on the If Clause.

Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim MRange As Range
Set MRange = Range("MS96A")
' If Not Intersect(Target, MRange) Is Nothing Then For Each cell In MRange Sheets("Sheet1").Unprotect Password:="temp"
cell.Interior.ColorIndex = 3
cell.Font.Color = vbBlack
Selection.Locked = True
Selection.FormulaHidden = False
Next cell
ActiveSheet.Protect Password:="temp", _
DrawingObjects:=False, _
Contents:=True, _
ActiveSheet.EnableSelection = xlUnlockedCells
End Sub

I am using the code below to disable the save function very successafully. However, is there a work around to allow a macro to save?
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

'this disables the save function on the XLS

MsgBox "****Save is Disabled****"
' Following line will prevent all saving
Cancel = True
' Following line will prevent the Save As Dialog box from showing
If SaveAsUI Then SaveAsUI = False
End Sub

I have found similar posts on the forum, but nothing without use of a userform.

I have the following code:


Sub Development()
 Pass = InputBox("Please enter development password", "Password")
 If Pass = "XYZ" Then
 Else: MsgBox ("Password incorrect, please try again")
 End If
End Sub

This works, but I want to hide the text as it is entered.
Is there a way I can enter this as a property? i.e. = ... or something?? I've tried what seems intuitive, but nothing works.


Hi guys,

Looking for some help and would appreciate your help. I want to prevent people cutting/copy/pasting on a spreadsheet I have developed. A couple of users keep doing so which in turn knackers my formulas. There will be occasions where I will need to be able to use these functions for maintenance and updates. Ideally I would like have a private marcro which I can run to enable these features as and when needed.

I've been at this all morning and feel like I'm going round in circles. I've tried various bits of code (sourced via google etc) & have ended up with a whole manner of outcomes but not the one I want.

To summaraise what I am looking for is some vba code which will do the following Disable cut,copy and paste when sheet is opened Enable cut,copy and paste when closed Have a macro which when run will allow me to cut/copy paste so as to implement updates when necessary.
Can anyone help?

Thanks in advance

I have searched and read all the help files. I find the properties of
an object, I see how I can "lock", "size and move with cells" or "not
move with cells". No matter what I select, the object moves off the
screen, when the user, scrolls to the right of the spreadsheet.

Is there a way to lock the position, let's say, in the upper right
corner and have it stay there?

This would be quite useful for an EXIT button, that I have created,
that will close the program without saving (it's a read-only file.)

Thanks to all the wonderful people here that have been so helpful and
give us their valuable insight and time.


Is there a way to lets say go to and automatically have VBA fill in the user name and password ? I am trying to automate login for my co workers to a certain site. Just havent been able to find out how. PLZ HELP !!

I'm trying to use VBA to go to a website that requires a User Name, Password, and a Submit Button.

So far I can get everything to work besides the Submit part. The code runs without errors, but doesn't actually "hit" the submit button on the webpage.

For posting, I removed my actual user name and password and and used the generic " User Name " and " Password " highlighted in blue.

I highlighted another section in green that I took from a previous post hoping it would solve my problem. The link is: /

Here is the code I am using:

Sub GoToWebSiteAndPlayAroundNew()

Dim appIE As Object ' InternetExplorer.Application
Dim URL As String

Set appIE = CreateObject("InternetExplorer.Application")
URL = " / "

With appIE
.navigate URL
.Visible = True

Do While .busy: DoEvents: Loop
Do While .ReadyState 4: DoEvents: Loop

.document.getelementbyid("fUserName").Value = " UserName "
.document.getelementbyid("fPassword").Value = " Password "

End With

On Error Resume Next
x = 0
For Each mitem In IE.document.all
mitem.Value = "x"
x = x + 1

x = 0
For Each mitem In IE.document.all
If x = "Submit" Then
Exit For
End If


End Sub

I feel like this should be really easy and I am just out of it today but I cannot figure this out. I want to lock a row and filter (with filter,not sort, tool) the other rows. I attached an example

The row in RED I want to never be changed or added in the filter, but I want row 2 and 1 to filter together. So I want (in this case) the flavor to filter with the same number. SO i guess the filter process would be dependent upon the total number of votes. Any ideas? Thanks!

I had to create the information in tables and went from there. Got it. Thanks!

Thnx for your help man. Now I have another situation.

I have the following:

1. Login form containing username and password fields.
2. Data entry form

I want to do the following:

1. Coding for username and password fields, which, If the login is successful, takes me to DATA Entry Form, Otherwise shows message "Invalid Login".

Thanks in anticipation.

Is it possible to share a workbook with macros and have the macros work properly. I have one spreadsheet that needs to be shared by many users. We want to all be in the same document at the same time saving changes. The real catch is that the workbook has macros. I used the 'Share Workbook' function under tools. At the end of the setup, it told me that the macros would not work properly. The odd thing is that everytime I try to click on one of the macros I get an error, but yet the macro still performs the function. So essentially the macro works, it is just a pain because you have to click 'end' everytime on the error screen. Any suggestions?


Hey guys,

I have an excel file that is password protected. I have opened it as read-only.. Is there any way to unlock it & do it modifiable when I already opened it as read only (of course without having to close it & re-open it and enter password lol)


Hello -

I am using Excel 2007. In prior versions of excel, when copying data, if I wanted to copy visible cells only, I would select "Go To, Special, Visible Cells Only" and then copy a range a cells. The default was always set to copy everything (including hidden cells), unless I specifically selected copy visible cells only.

In 2007, the default is somehow set to always copy only visible cells. Sometimes, I want to be able to copy all cells including those hidden but cannot seem to figure out how to swith this default option. I looked under Excel Options and did not see an option there.

I don't want to have to unhide and rehide everything each time i copy. I know i could do the hiding and unhiding via VBA but would prefer not to have to.

Thanks for your suggestions.


I'm quite experienced Excel user. I've never come across this problem but tinkering in every conceivable way within Excel settings and the solution has eluded me.

I have added a worksheet created elsewhere (it is a form I need printing, with the data coming from 2 sheets I have created from scratch) which has pre formatted cells for Date and Client Name etc.

When I try to reference the cell in this added sheet from my 2 sheets, instead of the result, it always displays the formula, not the result.

I have tried doing it from one of my sheets to reference to this new, and that displays the result and not formula. I can't imagine why it's doing this and I've never seen it happen before.

Formatting cells, giving cells names rather than the usually adequate of reference to the Cell Number doesn't change things. I wonder if I've picked up some legacy protection from the original form but can't see anywhere in the tools etc that's obvious.

There's about 50+ cells that need referencing and I got to get this done for work.

Please help me. This is my first need to post on a Excel Forum as I've always found help or answers from other peeps or internet but this one is making me scratch my head big time.


Is there a way to create a second worksheet that is based on data from an original sheet that will automatically update when you ADD ROWS to the original sheet?

Linking values between sheets is easy... but I need to be able to set a designated area on my A sheet that I can add rows into which will automatically be added to my B sheet.

Does anyone know of a function that I can apply for this?

Is it possible to apply a filter to multiple sheets within the same Excel workbook, using the same filter criteria?

For example, suppose you have tables of data on 3 different tabs, all having the same headings. Suppose one of the headings is "gender". If you apply a filter to the table on Sheet 1, to only show the rows containing the word "female", is it possible to have the tables on Sheets 2 and 3 automatically update to only show the "female" rows? Or would you have to manually update the filter criteria in Sheets 2 and 3?

I hope this makes sense. Thank you in advance for any help.


i've got the following problem:

I want users to double-click on a row on a protected sheet and then do some code based on the row-number of the clicked cell. I've protected the sheet because it contains a lot of formula's.

When a user double-clicks a row it triggers the code through the Workbook_SheetBeforeDoubleClick event.
After the code is executed Excel shows a message that the cell that was clicked was protected etc etc.

How can I prevent this message from popping up?

I've already tried

application.displaywarnings = false

but that didn't work


Hi there, longtime user firsttime poster. Looking for some help as I am a non-expert with macros. Here's what I'm trying to do:

We have to submit things to a certain regulatory body and we usually enter tasks in as soon as they come, do the submission, and then keep a record of that submission.

So, I have a workbook with two sheets, one is "TO DO", the other is "ARCHIVE". Both sheets have the same columns and everything. I am looking for a macro that will automatically cut a (row) from the TO DO sheet and paste it in into the ARCHIVE sheet once it is done, then delete the cut row from the TO DO list so it stays topped up.

The trigger for archiving is the columns M and N which are titled "Complete ?" and each has a validation drop down that says "YES". When both cells in columns M and N have the YES in them, I would like the macro to make the above mentioned actions.

I ran a search on the forums and found something similar, but not quite what I was looking for.

Any help?

I am trying to do a very simple copy and paste of a simple formula in Excel 2007 and nothing seems to be working. Excel will not let me copy and paste a formula and will only paste the value into to workbook. For instance, if I make a very simple spreadsheet such as:
A1 type in 10, A2 type in =A1 (calculated A2 to be 10)
B1 type in 5

And then click the copy on B1, and then click paste special on cell B2, the only options it gives me are text and unicode text and so no matter how I paste, cell b2 will always be populated with a value of 5. I cannot imagine a simpler copy and paste and no matter what I do I can't make this work.
All cells are formatted as general. It seems that all copy and pasting of formulas in my excel has been disabled. If I open any spreadsheet on my computer, I can't copy and paste formulas, but do the exact same thing on the exact same spreadsheet on any other computer and it works no problem.

Any help?

I have never really used VBA and so am completely stuck at this problem. I need to create a macro which auto-populates a master worksheet from the individual user sheets in a shared workbook.

Sheet 1 is the master sheet "Team Stats". There will be an undetermined number of individual worksheets to accomodate new staff.

Each worksheet will be identical, using columns A-I with row 1 having the headings:

Date, Name, Reference, Value, Price, Age, Purchased?, Destination, Add. Products (the last 3 columns will have a drop-down list which will be used to enter data into the cell).

There will be a varying number of rows in each of the individual sheets.

If possible I would like the macro to run every time data is entered into one of the individual worksheets. If this is not then it would be fien to update every time the workbook is opened.

If anyone can help it would really cut down the time I spend collating these stats every day!

I'm trying to come up with a solution to calculate the man hours and days worked over multiple sheets.

I have a file that has 8 sheets. the first seven sheets are the days of the week and the 8th sheet is where I want to calculate the hours.

The days of the week consists of "Name" "Date" Hours"

The 8th sheet consists of "Name", "Days of the week in their own column (7 columns in total)", "Total Hours" and "Total Days Worked"

Now... each day is always a different group and what I'm hoping for is to create a formula that can grab each name with their hours and throw them into the 8th sheet. So when the end of the week is done I have all the Employees weekly hours and days worked all finished.

I hope this makes sense. This file is to track about 100 employees that are on a rotational work schedule.

I have attached a sample file.

Thanks in advance for your help.

Related pages

excel time zone calculatorexcel sum colorhow to create a cumulative frequency graph in excelpaycheck calculator ontariovba syntax errorhow to open qfxsumif monthaccess vba query criteriavba round upfit gaussian excelunlock excel cells without passwordhow to calculate salary in excelhow to lock selected cells in excel 2007protect vbacondo budget templatefortnight tax tablehow to set an absolute cell reference3 axis excel chartdelete record vbamicrosoft excel subtraction formulareverse compound interest calculatorqueuing formulaswingdings happy faceexcel vba read text fileconvert kg to gbhow to merge all sheets in excel into onehow to randomize a list in excelvba combobox indexcharttype c#x y axis excelhow to do carriage return in excelexcel combo box propertiestype mismatch in expression access 2007trial and error excelhow to convert decimal to feet and inchesvba macro timerhow to reduce size of excel file with pictureshow to create a distribution graph in excelconversion of bytes to gbremove empty cells excelnested if condition in excelexcel if statement blankcredit card reconciliation templateexcel formula for age based on date of birthcalculate eigenvalues in exceldata type mismatch in criteria expression access 2007export from excel to access vbaunlock vbaexcel vba msgboxaxis slicerhow to recover deleted rows in excelexcel gauge graphprorated calculator salaryxirr function excelexcel identify duplicates in two columnsvba indexofexcel randomiseexcel 2007 developer ribbonerlang calculator downloadsinking fund calculatorblank football stat sheetsvin check digit calculatorexcel straight line depreciationmicrosoft query tutorialnested sumifdata validation list from another workbookhow to alphabetize names in excelformula bar missing in excel 2010excel pivot table hide filterpayback period formula excelduplicate finder excelhow to protect a worksheet in excel 2007cheque record book formathow to convert decimals to whole numbersexcel conditional formatting entire rowtimesheet formulas for excelcreating a calendar in excel 2007runtime error 2110