![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 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 |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Mar 2002
Location: Massachusetts, USA
Posts: 255
|
The first command should probably be
Sheets("Sheet1").Select Then the macro knows which sheet to start with. |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
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..
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
Hi
More bits what windows version are you running and you not possibly running Excel 2000 are you?
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|