Run time error- Please Help

jrussell

New Member
Joined
Apr 4, 2002
Messages
9
I have a problem. I have a workbook that is a overtime equalization project that I have been working on. It has departments in several worksheets that have macros that sort the employees by the lowest overtime hours.
In order to make the macro work, I had to include in the macro a command to unprotect the active worksheet otherwise, I got an error because there is some pasting that goes on in the macor also. Before the macro is finished, I have a protect active sheet command so the data is protect. Things like names, social sec. number, date of hire. I have a specific group of cells that remain unprotected because they are unlocked for data entry.
So anyway, my problem occured when I set the workbook up to be shared.
Now I am getting a Run time error '1004'. It states: unprotect method of worksheet class failed.
The first command in the macro is AcitveSheet.Unprotect.
Is this the problem?

Please help.

Thanks,

Jerry
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
The first command should probably be

Sheets("Sheet1").Select

Then the macro knows which sheet to start with.
 
Upvote 0
Hi

OK Run-Time Error 1004 is a wooooooper of a floor in the programming of Excel and is very common be that good its a bug/error thats covering a million issues, can i ask exactly what you do prior to the error and at what stage the error appears..

IF you script running can i request you do not debug, try step troough the line will trip as you run just that line, debug will do simular but i want to see if the running is hanging or if will run smooth if line by line....

Please give as much data / details as poss, or if poss post the script..
 
Upvote 0

Forum statistics

Threads
1,213,533
Messages
6,114,179
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top