Macros Enabled Spreadsheet With Protection

Feb 4, 2014

I would like to be able to password protect each sheet in a workbook and still be able to use the macros/form control (button). Below is the code that I'm using and the code that I've attempted to add to it to protect it.

Current Code:

[Code] ....

Code added for protection but not working:

[Code] ....

I've added this code to both the beginning and the end of my code; however, I'm getting a "400" error when I try to use the form control (button) when the sheet is protected. Is there something that I'm doing incorrectly?

View 6 Replies


ADVERTISEMENT

Workbook Protection Code: When Macros Are Not Enabled

Oct 23, 2006

I prtected several sheets with the xlVeryHidden command I got from you. But when the user does not allow Macros to be executed, also these protections are not executed. Does there exist any solution to this problem? Something like "when macros are not allowed do NOT open file"?

Sub workbook_open()
Application.DisplayAlerts = False
Application. ScreenUpdating = False
Application.AskToUpdateLinks = False
Windows("rechenfile.xls").Activate
Sheets("Daten").Visible = xlVeryHidden
Sheets("Koeffizient").Visible = xlVeryHidden
Sheets("Investitionen").Visible = xlVeryHidden
Sheets("Konsum").Visible = xlVeryHidden
Sheets("Zinssatz_permanent").Visible = xlVeryHidden
Sheets("Preise").Visible = xlVeryHidden
Sheets("Nettotransfers").Visible = xlVeryHidden
Sheets("Beschäftigung").Visible = xlVeryHidden
Sheets("Löhne").Visible = xlVeryHidden
Sheets("Nettoexporte").Visible = xlVeryHidden
End Sub

View 4 Replies View Related

Hide Toolbars When Workbook Protection Is Enabled

Jun 26, 2006

I would like to hide the standard and formatting toolbars in excel when i enable workbook protection, however I have no idea how to get excel to realise when workbook protection has been enabled, and how to hide the toolbars in VBA also. Also i would like to know how to do the reverse (how to show tooldbars when workbook protection has been disabled)

View 3 Replies View Related

Determining If Macros Are Enabled

Jul 8, 2006

How can I determine if the user selected "disable" at the initial macro prompt screen.

Basically, I would like a formula/function that can say whether Macros are switched on or off by the user.

View 9 Replies View Related

Excel 2007 :: Macros Enabled But Will Not Run?

Oct 27, 2010

I have an excel file saved as macro-enabled that is perfectly functional and can be opened on my computer (via Security Warning - Enable Macros). The file is saved on another computer, through which I am accessing by a network.

This other computer is unable to run the macros, and when we open the file in excel there is no security warning that pops up (like there is on my computer). I have gone to the Excel Options and entered the trust center settings, and finally the Macro Settings. It is set at Disable all macros with notification. (same for both computers... but on one of the computers there is no security warning that pops up)

We tried enabling all macros (temporarily) and tried re-opening the file and running a macro. We got an error message saying that macros were not enabled.

We also made the file a trusted location and saw no changes.

View 7 Replies View Related

How To Use Data Validation If Macros Are Not Enabled

Sep 8, 2012

I want to use data validation so that if macros are not enabled, data validation in a particular cell will not allow any entry. Maybe a helper cell that is TRUE if macros have been enabled? How is this done?

View 2 Replies View Related

Workbook To Open Only If Macros Are Enabled

Mar 29, 2009

I have created an Excel Workbook and this Workbook has a VBA code that enforces an expiry date of the workbook (TimeBomb from cpearson.com). So, if the expiry date has passed, the workbook will not open. But since it is VBA related, the expiry date will work only if one has enabled macros. If macros are disabled, the workbook will open regardless of the date.

So, is there a way for Excel to check if macros are enabled? and is there a way for Excel not to open the workbook, if the macros are disabled?

View 10 Replies View Related

Force Macros Enabled On Workbook Open?

Oct 28, 2013

I'm posting a workbook on our network that I want to enable users to go in and update. I have the workbook designed, with entry fields for the data they need to enter, and they then push "Submit" to submit the new data to a hidden tracking log within the workbook.

Many of the users will be complete Excel newbies, and although I haven't posted the workbook yet, I am trying to anticipate possible issues. The first that comes to mind is that the user opening the workbook may not have macros enabled in their version of Excel, and they will get a message, and can't perform the udpate. Is there a way to add a Workbook Open event that automatically enable macros in the workbook when they open it, even if it is for this workbook only?

View 5 Replies View Related

Warning Page If Macros Aren't Enabled

Jun 10, 2008

I'm making a little calculator thing for some of my colleagues, and I've created a warning sheet at the front in case their macro security is set to high or they disable macros.

The thing is, when the workbook is opened with macros enabled, and when it's closed, this warning sheet flashes briefly. Is there any way to avoid this?

My code is:

Private Sub Workbook_Open()
Worksheets("Form").Visible = True
Worksheets("Form").Activate
Worksheets("Enable macros").Visible = False
UserForm1.Show
End Sub

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.ScreenUpdating = False
Worksheets("Enable Macros").Visible = True
Worksheets("Form").Visible = False
Me.Save
Application.ScreenUpdating = True
End Sub

View 9 Replies View Related

Workbook Hangs When Opened With Macros Enabled

Jan 30, 2008

I have been working on an excel spreadsheet and have come acrss this problem once before too. When I try to open this file it hangs and does not respond. the file size is not too big (490KB). When I disable macros i can open the same file but when the macro are enabled, it hangs. have been trying to look for a solution but just dont know what to do.

View 3 Replies View Related

Hide Picture By Default, Display If Macros Enabled

Apr 7, 2008

Basically, I want cell A1 to display the message "Macros must be enabled for this document to display properly", then have that text replaced with a picture (jpeg logo) if macros are enabled. I know I need to put the code in the Workbook_Open sub, but I keep getting the "error 1004, cannot modify visible property of picture object" when I try to tinker with "visible = true".

*EDIT* - The picture must be embedded in the spreadsheet somehow, and hidden from view when macros are disabled. (Having the picture crammed into a single cell at IV65536 is fine.)

Thoughts?

View 10 Replies View Related

Excel 2007 :: Macros Enabled But Record Macro Grayed Out

Apr 14, 2008

I have excel 2007 and I want to record a macro. I have enabled all macros via the Trust Center settings and have even saved the current workbook (created from scratch in 2007) to a macro-enabled version.

But when I click on the 'developer' toolbar, 'record macro' is grayed out.

View 9 Replies View Related

If Macro Is Disabled: Place A Message On The Sheet Saying This Will Only Work With Macros Enabled

Aug 17, 2006

When you enable macros the sheets 2, 3, 4 ect are visible but if you disable macros, you only see sheet 1 and and you can place a message on the sheet saying this will only work with macros enabled.

View 2 Replies View Related

Macros And Protection ..

May 22, 2006

I have a scoresheet with 60 contestants. Each contestant takes up 7 rows,
the first six of which are hidden to start with and I have put macros in the
adjoining column so that when they are clicked, the full 7 rows open up and
the table of scores can be entered, When entry is complete for that
contestant, a further macro when clicked will close up the 6 rows, leaving
just the main line (line 14) with the No, Name, “OPEN” macro and other Totals
in adjoining columns.

The sheet works fine, but as many people will use this programme, I need to
protect the sheets against mistaken entries etc., and as soon as I protect
it, the macros wont work and throw up a “unable to set the property of a
hidden range class, run time error 1004. I don’t want to leave the sheet
unprotected, can anyone advise me where I am going wrong.

I am also trying to find a way to validate “time taken” entries so that they
can only be input as minutes and seconds in the format of 09.56, within a
range of 00.01 – 10.00. Not having any success with this as it keeps
converting the data into something like a date.

View 9 Replies View Related

Macros And Protection

Jul 3, 2008

I have a excel Workbook, 6 sheets and many calculations with formulas and macros.

Is there a way to protect this workbook to be able to insert data only in the correct cells, I tried but the macros does not work, they are essentially copy and paste.

there will be 3 sheets with reports to be printed too.

View 9 Replies View Related

Workbook Protection In Macros

Oct 27, 2006

In addition to the code below that hides data if macros not enabled, prevents copy and cut (I know its still possible) I would like to as well as protect the sheets (which works fine) also protect the workbook to prevent moves etc. Unfortunately while the protection may be easily applied, the veryhidden bit to ensure macros are selected then conks out. Does anyone out there know of a way where say the workbook protection may remain and at the same time allow the veryhidden etc bits do their stuff as normal as if the workbook protection was off?

Private Sub Workbook_BeforeSave _
(ByVal SaveAsUI As Boolean, Cancel As Boolean)
If Cancel = True Or bIsClosing = False Then Run "HideAll"
If SaveAsUI = True Then Cancel = True

End Sub
Private Sub Workbook_Activate()
Dim oCtrl As Office.CommandBarControl
'Disable all Cut menus
For Each oCtrl In Application. CommandBars.FindControls(ID:=21)
oCtrl.Enabled = False
'oCtrl.Enabled = True
Next oCtrl...................

View 5 Replies View Related

Spreadsheet That I Have A Lot Of Macros That Are Attached To A Customized Toolbar Saved In The Same Spreadsheet

Jun 26, 2008

I have a spreadsheet that I have a lot of macros that are attached to a customized toolbar saved in the same spreadsheet. I saved this is a read-only file. When I open as read-only and run my macros (testing), I save it as another file. When I then open the "template" to do the same thing, the toolbar/buttons now reference the file I previously saved as something else. Help please? Is there a macro that would delete all macros before saving the file as something else?

View 9 Replies View Related

Adding Worksheet Protection But Allowing Form Controls - Macros

Jun 5, 2014

I have a worksheet with lots of things going on... the end user needs access to the Name field, DOB field, all the scroll and form control option buttons in the 9-question sheet, and the macro-enabled reset button at the bottom. Formulas are sprinkled throughout the worksheet, in columns T through AC... option button links go to AA and AB.

I would like to protect the entire sheet so none of the fields, except where indicated above, could be selected or edited... but when I protect the sheet, I get errors when trying to use you form controls, and the formulas do not respond. And finally, when protected, I get a debug error on the reset macro.

View 2 Replies View Related

Spreadsheet Password Protection

Jul 24, 2008

I have a payroll spreadsheet that is going to be placed on our network server. My boss wants me to have this spreadsheet to be protected so that one person can get in, add hours and commission, and save it up on the server. Then another person can go in to that spreadsheet, open it up to get the info and use it to cut the checks. What my problem is that the person who is making the changes does not need to see the pay rate or the total dollar amount columns, but the person who gets the data out does. Neither one of these people really know how to hide and unhide columns in Excel, so I need it to have when one password opens it, the pay rate and total pay columns are hidden, but the other password will show those columns.

View 9 Replies View Related

Spreadsheet Protection Based On Employee ID

May 12, 2006

I have a productivity report that is posted on an intranet. I only want the members of my deptartment to see the productivity results. To accomplish this, I need help creating a VBA so the names in column B will only populate if an employee enters his/her 6 digit employee ID correctly in cell B1. If the ID entered is not listed in column B of the "Rep ID Master" sheet, then an error message should pop up stating something similiar to, "Incorrect ID. Please Enter Your 6 Digit Employee ID". Also, Since I don't want the entire company to see our dept's productivity numbers, I want the VBA to prevent the associate from saving changes to the sheet, but still allow me to do so--preferably via a password.

View 9 Replies View Related

Protection Of Tabs Within A Spreadsheet Or A Range Of Cells

Nov 2, 2007

Can you passwrod protect a tab or a range of cells within a spreadsheet

View 9 Replies View Related

Making Copies Of Spreadsheet Containing Macros?

Aug 28, 2013

I have created a spreadsheet containing about 30+ macros and then copied it with a new title eg, sheet2013.xlsm (original) and sheet2014.xlsm. My problem is that every time I open the 2014 sheet it re-connects to the macros in the 2013 sheet (if this makes any sense). Is there a way to lock macros to a spreadsheet, ie open both sheets and use the macros within those sheets?

View 1 Replies View Related

Macros - Database Setup Using A Spreadsheet

Oct 1, 2008

I'm not sure if this is something that can be done by macro, I have a database setup using a spreadsheet in Excel. The first column is a list of customer names, that can be filtered by customer name. If I filter the column, using for example the name Jones, is there a way to add up all the units of the product that they have purchased?

View 9 Replies View Related

Prevents Macros From Running When Spreadsheet Is Opened?

Mar 14, 2009

I have 3 macros, 2 of them puts formulas in 2 separate cells and the other to turn off file save, file save as and the Save button. Everything was working fine until I password protected the project, now the macros quit loading. I can still run them manually and they work fine, they just don't run when the spreadsheet is loaded. (What I wanted to do was prevent users from seeing the formulas by saving the spreadsheet after the formula was put in the cell and also by looking at the macro). I've unpassword protected the project and took out the macro to prevent the Saves. What do I need to look at to get the macros to run when the spreadsheet is loaded?

View 4 Replies View Related

Run-time Error '50289' :: Project Protection / Module Protection / Module Visibility

Aug 18, 2004

I recieve an error :

Run-time error '50289':
Can't perform operation since the project is protected.

When i try and run my code.

The code does add parts to modules and workbook events, but I need the code to be protected.

View 9 Replies View Related

Macro Enabled Workbook IOS App?

Dec 5, 2013

Is it possible to have a macro-enabled workbook to work on ios software(iphone or ipad app)? Currently I cant find any spreadsheet app that will let you have a macro enabled workbook. The code from the posts below would be great if they worked on my phone or ipad.

Scan barcode to excel with date & time stamp in & out.

View 4 Replies View Related

Save As Macro Enabled Document Only

Mar 6, 2014

I have been having a problem with a document which I have created as a xlt format which then is saved locally but because some users arent as computer literate I have found them saving the document in non macro enabled format which means all macros are removed causing me a huge issue. Is there a macro which will only allow the document to be saved as macro enabled?

View 2 Replies View Related

Protecting Macro-Enabled Workbook

Apr 29, 2012

is it possible to protect a macro-enabled workbook with password.

View 5 Replies View Related

Macro-enabled Template Without Warning

Feb 13, 2010

I have created a template including a macro. It works as expected besides the issue that macros need to be enabled manually. This is totally annoying. I need to have it work directly.

Or what would be another way to have a macro available all the time I run Excel?

View 9 Replies View Related

Show Data Table - Functions Not Enabled

Mar 27, 2014

When I select anything under the Data Table drop down nothing happens. It is like none of the functions are enabled?

Data Table Picture.png

View 2 Replies View Related







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