Macro Error After Protect File
Jan 4, 2010
I created excel form with calculated formula and macro. Everything worked fine. To protect spreadsheet formula I protected file. But after protection when I ran file I get macro error message. Then I remove protection become work without error messgae. How to fix that problem?
View 6 Replies
ADVERTISEMENT
May 3, 2012
This first macro works fine:
Sub UnhideHBPorCholesterolQ1toQ3()
'
ActiveSheet.Unprotect "password"
Rows("58:67").Select
[Code]....
why the second macro does not seem to work. I get a Run-time error that says "Unable to set the Hidden property of the Range Class".
View 1 Replies
View Related
Mar 7, 2012
I am receiving an error at
Set CopyRng = Wkb.worksheet1.Range(Cells(RowofCopyworksheet, 1),
Cells(Cells(Rows.Count, 1).End(xlUp).Row, Cells(1, Columns.Count).End(xlToLeft).Column))
I am trying to copy the first sheet in each file in the designated folder and paste it into a master worksheet.
Below is the code.
'Description: Combines all files in a specific folder to Format File for Upload.xls
Sub MergeMultipleFiles()
Dim path As String, ThisWB As String, lngFilecounter As Long
Dim wbDest As Workbook, shtDest As Worksheet, ws As Worksheet
Dim filename As String, Wkb As Workbook
Dim CopyRng As Range, Dest As Range
Dim RowofCopySheet As Integer
[Code] ....
View 1 Replies
View Related
Feb 2, 2007
When it opens the desired file, it increments the file name by 1 each time it is opened (via the macro).
Example;
The first time it is opened you see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages1"...
I close the file and open it again (via the macro), and see the file name in the header read "P'Binder L&T Pages" for a moment, then it changes to "P'Binder L&T Pages2"...
The file name continues to increment on every opening until the PC is rebooted, then it starts at 1 again.
Sub OpnLTpages()
Dim wb As Workbook
Dim AlreadyOpen As Boolean
AlreadyOpen = False
For Each wb In Workbooks 'Scan open workbooks
If wb.Name = "P'Binder L&T Pages.xls" Then ........................
View 9 Replies
View Related
Mar 26, 2009
I thought that I had this working completely, but the test to see if the "file is already open" isn't working.
Something is wrong with my example.
I have marked in the code where the problem is. Everything else works. It's marked as such: ...
View 4 Replies
View Related
Oct 26, 2006
I have a user form with a TextBox (TextBox1), the user enters a filename and presses CommandButton1, this then opens the file. I have set an error trap so that if the file does not exist a MsgBox prompts the user to re-enter. So far so good, however if the error trap operates any further files entered are declared as non-existent even if I know they exist. I thought this would be quite easy but once again VBA bites me back!!
here is my code
Sub CommandButton1_Click()
stPath = ThisWorkbook.Path
stFilename = "Retention" & "" & TextBox1 & ".xls"
stFullname = stPath & "" & stFilename 'completes full path of for TextBox1
On Error Goto Errorhandler: 'go to this if file does not exist
Workbooks.Open stFullname
ActiveWorkbook.RunAutoMacros xlAutoOpen
View 6 Replies
View Related
Jun 18, 2012
When I am running a macro in excel 2003/windows 7 and trying to create a text file, it is giving this error. I am attaching two pictures.
View 1 Replies
View Related
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
Jul 12, 2012
My boss has come to me and asked how does she get her file to go back to the way it was before, she had a password on the file but you used to be able to click on a button that said "Read only" this button no longer appears and i am unable to get it back. I still get the password box pop up but it is smaller and does not contain the read only button.
View 3 Replies
View Related
Mar 24, 2009
I have a file used by our employees through our local area network. Because that file has many functions and possibilities that took us a lot of time to create, I would like to protect this file so no employee can copy it to an external device without a password. It would be great, though, if the file could be exchanged or sent among employees as logn as it remains WITHIN our internal network.
Is it technically possible to protect an Excel file in a such a way?
View 9 Replies
View Related
Jun 14, 2006
I have one workbook which when a macro is run, creates a new workbook. I am trying to then get this new workbook to have both "ReadOnly" and "Hidden" status. but when I use Set attr it only picks up one.
I need to be able to turn of the readonly status and update the file and then re protect it.
View 7 Replies
View Related
May 13, 2014
Is there a way to protect the conditional formatting of accessible cells in a protected sheet.
Detail: I have a protected excel sheet. However some of the cells are made accessible so others (my secretary) can fill them up. The accessible cells have conditional formatting which become nonfunctional during pasting from other sources if "special paste" is not used.
View 2 Replies
View Related
Dec 19, 2006
the spreadsheet needs to be copied to a directory called "C:downloads" as it contains a ODBC query to itself (In reality, this is a query to an External Oracle Database)
On loading, it should pop up a simple userform, with a combo and two command buttons, which when pressed takes you to a (hidden) tab that displays a pivottable.
All works well until I try to close /save when 60% of the time, Excel encounters problems and closes and will not load up the file the next time until either quit excel or disable macros. Messages include "file/path access error", "I/O Error" or get restarts excel.
On a casual run through, I expect you might report back that "All worked ok for me". Please can you give it a bit of a thrashing, comment out the userform show, save the file (frequently) becuase i assure you it will break ultimately!
This is a brand-new file and I've tried it on about 5 different PC running different versions of Excel and generally get the same result.
View 7 Replies
View Related
Jan 17, 2013
Some sensitive data is held on worksheets that are used by people that do not have access to see the data.
It would be most convenient to keep the data in these worksheets but hide it from view of the users.
Is there a way to password protect a users ability to unhide a column?
View 2 Replies
View Related
Jan 6, 2006
How can I protect a macro from other people changing it?
View 6 Replies
View Related
Dec 4, 2008
I have button on a worksheet that has a macro assigned. I need other people to see the workbook, but I want the button DISABLED for them to click, but able for me to click it. I have written in the macro to protect the sheet once it has run, but the button is still pressable.
View 2 Replies
View Related
Oct 24, 2007
I currently have a macro which i run by selecting tools, macro, macro and then selecting the one i want and pressing run. if i press run I want a box to appear asking me to input a password and if password matches then run that specific macro, can this be done
View 2 Replies
View Related
Oct 22, 2008
Is there a way to password protect the macro code, so that someone can't open the coding?
View 4 Replies
View Related
Mar 20, 2008
I have a workbook with some sheets password protected and other sheets not protected.
I have a macro that unprotects the sheets, but it requires the password to be typed multiple times.
I want to put the password into the macro so it doesn't require manual entry of the password lots of times.
Each sheet has the same password, so I would expect to enter it for the first sheet only.
What I have came from a simple macro recorder selecting each sheet in turn:
Sheets("wages").Select
ActiveSheet.Unprotect
Sheets("Comparative").Select
ActiveSheet.Unprotect
View 9 Replies
View Related
Sep 16, 2008
i use a macro to protect several sheets in a workbook.
When i protect the sheets, i only want to be able to cells and nothing else. How should i mdify the code below to do this? I tried record the macro and un checking the "select locked cells" box which is one of the only 2 boxes checked. It works, but then when i save the wb and re-open it it allows me to select locked cells.
Sheets("FF - WC").Select
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True
Sheets("FF - UR").Select
ActiveSheet.PROTECT DrawingObjects:=True, Contents:=True, Scenarios:=True
View 9 Replies
View Related
Aug 21, 2008
Greetings I have a workbook with many sheets and i want a macro to protect all the worksheets with certain settings except for one sheet, sheet 3.
I have borrowed some code from this page that I cannot get to work and I would appreciate any help. the code should also have an if statement that unprotects sheet 3 but i don't know how to do that either. I just get syntax errors
Private Sub Workbook_Open()
Dim wSheet As Worksheet
For Each wSheet In Worksheets
wSheet.Protect Password:="secret", DrawingObjects:=True, Contents:=True, Scenarios:= _
False, AllowFormattingCells:=True, AllowFormattingColumns:=True, _
AllowFormattingRows:=True, AllowInsertingRows:=True, AllowDeletingRows:= _
True _
.EnableSelection = xlUnlockedCells
.EnableOutlining = True
Next wSheet
End Sub
View 9 Replies
View Related
Oct 23, 2008
I am looking for a way to protect and unprotect all worksheets with a password through a macro. I have excel 2007.
View 2 Replies
View Related
Sep 10, 2009
I have recorded the following macro and wish to add unprotect (with password), run the macro - which formats the worksheet and then password protect all cells with the exception of range E15:H413 which I want to leave editable by users.
View 9 Replies
View Related
Dec 17, 2009
I've created a file where our accountmanagers can mace price calculations. But eversince i've added a macro to force them to fill the form completely, they have gone and tried to hack the macro (and with succes).
I now would like to add a protection for the macro, so they can only access VBA when "sheet1" is unprotected. How can i do this?
I also would like to create a macro so they only can save the file as a Macro Enabled Excel file (.xlsm),
how can i do this best? .....
View 9 Replies
View Related
May 9, 2006
I have two macro buttons on a page that hide and unhide columns. When I got to protect the sheet .. the buttons no longer work and ask me to DEBUG. Is there a way to have macro buttons performing tasks AND have the sheet still protected?
In the protect sheet window .. am I have ticked is
Select Locked Cells
Select Unlocked Cells
But these are ticked as a default.
View 2 Replies
View Related
Nov 9, 2006
Is there an easy way (using a macro) to unprotect and protect sheets?
Most sheets in a certain workbook are protected except a few cells that are open for manual entry. Because I have links to other cells in other workbooks, I must unprotect those sheets/fields before I can edit the links. And I MUST ensure all sheets are protected again when I'm done with my work.
Also, is it possible to password-protect that specific macro so I'm the only one who can run it to unprotect and protect?
View 9 Replies
View Related
Dec 5, 2006
i want to make a macro available just for me with help of a password, so that the other users can't run this spesific macro without this password.
View 5 Replies
View Related
Jan 31, 2008
I need my people to run all kinds of macros, but I want to password protect one of them.
View 6 Replies
View Related
Jul 12, 2013
I have a spreadsheet with over a hundred tabs, each of which need to be password protected (same password).
I found code on CFO.com that got me half way there. It protects all the spreadsheets, but it does not password protect the macro itself, meaning that anybody can step into the macro and unlock everything at the click of a button.
The code looks like this.
VB:
Sub ProtectAllSheets()
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="secret123"
Next ws
MsgBox "All Worksheets Protected"
[Code] ....
What can I do to prevent people from stepping into the macro, or prompt a password to actually use the macro itself?
View 1 Replies
View Related
Jun 20, 2014
Macro to Run all tabs in a workbook and prompt a pop up asking about sheet protection for each tab, such as Select locked cells, and select unlocked cells.
View 8 Replies
View Related