Work Around Running Macro On Protected Workbook?

Jun 5, 2014

I cannot run a macro because I am encountering error 1004, intersect of object. i am using a protected workbook, and I dont have the password to unprotect it, but it needs to be fill out using a macro from a different workbook. Is there a way around this?

View 1 Replies


ADVERTISEMENT

Excel 2007 :: Running Macro From Protected Workbook

Mar 13, 2008

I have a macro with "ActiveWorkbook.Protect Password:="password"" . It was working fine in excel 2003. In excel 2007, because of this I am not able to run any macro's in the workbook. I am getting a message "The macro may not be available in this workbook or all macros may be disabled. I can see a security warning in message bar saying macros have been disabled, but I dont have have a option to enable the macros.

View 9 Replies View Related

Running A Password Protected Macro Remotely

Jan 26, 2007

I have a macro in a workbook (good start) as follows:

Sub UnhideSheets()

' Set to Auto Calc mode

With Application
.Calculation = xlAutomatic
End With

' Asks for a password (must be "unhider")

Dim mypass, response As String

mypass = Application.InputBox("This macro requires you to enter a password to proceed." & vbCrLf & "Please enter password below.")

' If password is correct

If LCase(mypass) = "unhider" Then

' Unhides all sheets

Dim i As Integer
For i = 1 To Sheets.Count
Sheets(i).Visible = True
Next i

' Then tells you that all is OK

response = MsgBox("All sheets unhidden", 0, "Macro run")

' Otherwise

Else

' Tells you that there is a problem (Unauthorised to continue)

response = MsgBox("Sorry, you are not authorised to use this macro.", 16, "Macro stopped")

' hides the sheet again

Sheets("BSG Only!").Visible = xlHidden
Sheets("CC07").Activate

' And ends the "if"

End If

End Sub
This unhides the "very hidden" sheets that make the book work and is password protected because I want to limit the people who can see this data.

What I would like to do, however, is call this macro remotely from another procedure in a separate book, which can only be accessed by those who are authorised to see the hidden data.

Essentially, then, my question is: "How do I call the protected procedure without the user having to enter the password each time, as they must be authorised to have access to the procedure that calls the protected procedure?"

View 3 Replies View Related

Error Running Macro When Sheet Is Protected

Sep 9, 2008

I am getting an error when I protect a worksheet and save it. Upon re-opening the worksheet, I try to use the cells that are being formatted by a macro, but I get the following error...

Run-time error '1004':

Unable to set the NumberFormat property of the Range Class.

If I open the worksheet and it is already protected from when I last closed it, then I get the error. If I unprotect the sheet, then close it and reopen it, then I don't get the error. Does anyone know what I might be missing or doing wrong.

View 9 Replies View Related

Macro Wont Work When Sheet Protected

Sep 19, 2006

I have used a small macro to format the sheet to hide cells with no entries and then print. The problem is that when the sheet is protected, then macro wont work. The sheet needs to be protected by the end user. I am only really learning excel, I could add to the following so the sheet can remain protected?

Intersect(ActiveSheet.UsedRange, Range("O:O")).Offset(0, 1).Select
Range("O39:O155").Select
Selection.EntireRow.Hidden = True
Columns("O:O").Select
Range("O21").Activate
Selection.EntireColumn.Hidden = True
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Cells.Select
Range("A21").Activate
Selection.EntireRow.Hidden = False
Columns("N:P").Select
Range("N21").Activate
Selection.EntireColumn.Hidden = False
End Sub

View 4 Replies View Related

Work On Other Files While Running A Macro?

Nov 28, 2008

I have designed a macro which consists of a form through it takes the input into excel sheet. The macro is running fine and I dont have any problems with it. The problem I am facing is that after I start running this macro, I am not able to access any other open excel files. Is there any option to make all other excel files available during running a macro?

View 3 Replies View Related

Progress Bar To Work While Running The Macro

Jul 6, 2005

I was looking at a previous post to get a progress bar to work while running
a lengthy macro. Below is the post on how to incorporate the progress bar
into your code.

That works fine expect for one thing. There is a cancel button on the progress bar, and when it is pushed the rest of my code continues running. How do I end my code if I press cancel on the progress bar?

Sub Main
Dim PB as clsProgBar
Set PB = new clsProgBar

'if your subs are being called from a userform, hide the form first using
Me.Hide
With PB

.title = "some title"
.caption1 = "Executing, this may take a while"
.caption2 = "Doing task 1"
.show
doevents...................................................

View 14 Replies View Related

Copy And Paste Doesn't Work If Macro Is Running

Jun 27, 2008

I have my macro that every second does a copy and paste.
but window doesn't copy and paste anything else but the macro's value
is it normal?

View 9 Replies View Related

VBA Macro Not Working When Workbook Is Protected

Apr 23, 2008

I wish I could have been more specific with my Title. This is what I am encountering. I used the McGimpsey code for generating a unique sequential number every time a workbook opens. I tailored the code to fit my needs and stuck it into my invoice sheet. For the longest time I was unable to make it work until I moved the code from a template to a standard workbook. Then I was able to make it work as long as the sheet was unprotected. I realized that to get the code to work I had to then unprotect the cells that the code was writing to. Now that I've done that I am getting errors in the code that weren't there before, rendering the macro useless. The code I am using is:

View 14 Replies View Related

Password Protected Macro Workbook - Remove Protection

Jun 6, 2014

In my office, our colleague locked his macros before he left. Now, I would like to continue in that but I have no idea, how to get into macro - to study it and change it as needed now.

How to open it?

locked one.xlsm

View 2 Replies View Related

Running A Macro From A Different Workbook

Dec 18, 2008

I have 2 workbooks (Workbook1 and Workbook2).

Workbook 1 contains a button, that calls a macro. This macro calls a macro from Workbook 2.

For this, I am using the Application.Run function.

The Macro in Workbook2 is a simple one line macro that updates cell A2 to a value of 6.

Range("A2").Value = 6

This works fine!

However, I want the the cell A2 in WORKBOOK1 to change to 6, not the cell in Workbook 2.

To add an element of difficulty, Workbook 1 could have any name (I won't know what it is, as the user could change it).

How can I get the Macro in Workbook 2 (Called from Workbook1), to update the cells in Workbook 1.

View 12 Replies View Related

Running Macro In Another Workbook

Sep 17, 2009

I have 2 files in a folder, "Main.xls" and "My Database.xls". "My Database.xls" contains the following macro in 'Module1':

View 2 Replies View Related

Trying To Get A Workbook.Open Macro To Work

May 29, 2007

I'm trying to get a Workbook.Open macro to work. I"m using the exact name for the location. For example:

Workbooks.Open ("O:AdministrationPM Weekly's2007PMWeeklyWE")

My other locations are working fine. For example I am using:

Workbooks.Open ("O:AdministrationDCS Week EndingStats"

View 9 Replies View Related

Macro To Work In A Differnet Workbook

Sep 24, 2009

I have the below macro that works well

Sub Button68_Click() 'Creates delivery note

Dim stIDSelect As String
Dim stC As String
Dim C As Range

stIDSelect = InputBox("Enter RMA number you want to create a delivery note for")
If stIDSelect = vbNullString Then Exit Sub

Dim idRow As Range
Set idRow = Intersect(Range("A:A"), ActiveSheet.UsedRange).Find(stIDSelect)
If Not idRow Is Nothing Then
Dim i As Integer................

View 9 Replies View Related

Running A Macro Process On Each Sheet In A Workbook

Jan 27, 2008

I am trying to write a macro that will run another macro (already written) through all the sheets/tabs in a workbook one sheet at a time and will stop once it reaches the last sheet/ tab.

Can you assist me in writing this macro.

View 9 Replies View Related

Get Filename And Path Of Workbook The Macro Is Running In

Apr 17, 2007

Is there a way to find the full name and path of the workbook the macro is running in?

View 4 Replies View Related

Running Macros On Protected Sheets ....

Feb 19, 2007

I have the following code as workbook module but it is not working, I have tried fiddling with it but I cannot work out what is wrong, can anyone help please.

Private Sub Workbook_Open()

Dim ws As Worksheet ....

View 9 Replies View Related

Macro To Work On 1 Sheet Not All Sheets In Workbook

May 24, 2006

Well this excel workbook has lots of sheets each for a specific region eg, Europe, austin etc and also sheets which have relevant data that gets used in the formula.

Now, say for eg lets considered the sheet called austin.

it does the calculations on the headcount needed for call center.
so the columns refer to a formula called gets() which then calls the erlanc function.

Now the problem here is this gets() function takes a value called calc

and this calc just a cell in one of the sheets called table. Now if I change the headcount value in the austin sheet nothing happens. Then I need to change the value of calc cell say make it to 5 or 6 and hit enter. It starts calulating the values to forecast thye headcount, but it does so for all the sheets . so it is taking a lot of time.

how to get make it run only for one sheet.

View 9 Replies View Related

Outlining Does Not Work On Protected Sheet

Feb 3, 2014

I am using Outlining on a sheet called "Today".The sheet is manually protected but now the outlining does not work as it says sheet protected.Is there a code i can use so that i can still have the Outlining working in a protected sheet.

View 5 Replies View Related

Macro Doesn't Work When Workbook/File Is Shared

Aug 30, 2006

I am encountering a specific scenerio where In I am creating a New file by copying one of the sheets And renaming that With todays date. here starts me problem when I try To share the sheet To work around I am seeing that th macro Is Not copying the sheet properly even though i have given PasteSpecial. The code goes here

VB: AutoLinked keywords will cause extra spaces before keywords. Extra spacing Is Not transferred when copy/pasting, but Is If the keyword uses "quotes".
Sub Newsheet()
sheetname = Format(Now, "dd-mmm-yyyy")
MsgBox sheetname
sheet_count = Worksheets.Count
'Checking for Replication................

View 9 Replies View Related

Excel 2007 :: Hyperlink Not Work With Cell Protected

Oct 24, 2012

Excel 07

I inserted a hyperlink into a cell that goes to a web page. It works when the sheet is NOT protected, as soon as I protect the sheet it stops working. How do can I lock the workbook and that cell so nobody can change it but the hyperlink still work?

View 2 Replies View Related

Macro To Copy Over And Paste Data In To A Work Sheet From A Closed Workbook

Nov 23, 2009

I have a macro code which gets the file list from a folder i specify and puts it in to an excel sheet as a column. I have then made a drop down list from this so the user can select the file they want.

From this file i wish to copy the data on a sheet that i specify. For example the sheet "dump" from file FR7_19.11.2009.xls (which will be a closed workbook) and paste its content in to the sheet "dump" in Summary.xls

I have a macro which opens up the closed workbook FR7_19.11.2009.xls and copies the sheet "dump" and then creates a new sheet of the same name and content in my current workbook (Summary.xls). However when i wish to select a different file to load in to Summary.xls "dump" the formulas i have been calculating information from this sheet all come up with #!Ref errors. I know this is because the macro i use deletes the old dump sheet before re adding a new one containing new data.

I am therefore looking for a macro which will simply just copy and paste the data from any file i select in to a sheet named "dump" as the data is always set out the same in every file but the values are different. I assume this will then mean that any formulas i use relating to this "dump" sheet in Summary.xls will work because the sheet is no longer being deleted and re-added the data within it has just simply been copied over.

View 2 Replies View Related

Why Doesn't Escape Work While Sleep Is Running

Feb 3, 2014

Why doesn't Cancel (Escape key) work while Sleep API (kernel32.dll) is running?

I was looking at making a minor change to a solved thread (see [URL] ....)

I would like the user to be able to exit the form by pressing Escape. I altered the start and end of the sub to below but it didn't work:

START:

[Code]....

END:

[Code] .....

View 2 Replies View Related

How To Get A Macro To Work With Any Work Book Name

Aug 24, 2009

i have a made a macro that copies info to a new sheet now that is working great but if i change the name of the work book it wont work any more so i need the macro to work with what ever name i give the workbook

the current name is

AVERAGE PRICE (update 2009) Mimmos Armico 170809.xls

i have attached the code in notepad ...

View 8 Replies View Related

Check If Workbook Is Protected

May 1, 2007

I just noticed that if you already have a workbook protected and then run code that will protect it, it will become unprotected! (I have a line of code to protect the workbook in the workbook_open event; incase the last user unprotected the book on the last use). Apparently it doesn't work like protected worksheets, where if the sheet is password protected and you have code that tries to reprotect it with a different password nothing will happen. I can not find a way to check if the workbook is protected (and if so skip, but if not then protect). Worksheets have "activesheet.protectcontents" to tell you True/False.

View 3 Replies View Related

Change Row Height In Protected Workbook?

Jan 21, 2011

I'm looking to enable changing row height in a protected workbook and am scratching my head as to if there is a combination of checkboxes I need to 'allow', or if there is some other approach.

I'm using a vba macro to change the height of merged cells:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim NewRwHt As Single
Dim cWdth As Single, MrgeWdth As Single

[Code].....

View 2 Replies View Related

How To Unprotect A Workbook And Sheets That Already Protected

Mar 10, 2014

I have a workbook that is protected by password. I have to unprotect sheets.

How can I unprotect sheets and workbooks while I am updating or changing?

View 13 Replies View Related

How To Open Another Workbook That Is Password Protected

Nov 7, 2011

Code:
Sub Open_Test_File()
Dim wb As Workbook
Set wb = Application.Workbooks.Open("DesktopTest File.xls")
End Sub

This very simple little code opens a new workbook.

But if I add a password to the file that I'm going to open the password box appears.

What do I need to add to this code to automatically input this password?

I have tried putting this at the end:

Code:
Password:="123"
but this does not work?

View 2 Replies View Related

Link To Password Protected Workbook

Jan 24, 2012

I have a master for each manager that pulls a few values from each of their employees personal sheets.

The personal sheets (about 30) are individually password protected so only the owners can open them.

This is creating a security issues as the links in the master require the passwords for each of the "source" workbooks.

Is there any way to add some code so that the passwords do not need to be entered each time?

View 9 Replies View Related

Linking To A Password Protected Workbook

Apr 18, 2009

My question is as follows:

I have two workbooks in the same folder on a shared drive. Workbook2 is linked to workbook1. I have protected Workbook1 with a password protected to limit access.

When my collegues who use workbook2 try to open it, it asks for the password for workbook1 before opening. When they ignore that and go a head to open the file. The new information from workbook1 is not updated into workbook2.

How can i mentain my password in workbook1, and keep the files linked such that they can be able to see the new information in workbook2 without knowing the password for workbook1.

View 9 Replies View Related







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