Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro Not working in Shared workbook
I have following vba code in excelworksheet. but i am getting run time error
1004 - method unprotect of object '_worksheet' failed while using it. Please advise how i will be able to run these codes in shared workbook. Private Sub btn_start_click() mystartrow = 11 Do While Sheet1.Cells(mystartrow, 5).Value < "" If mystartrow = 35 Then Exit Sub End If If Sheet1.Cells(mystartrow, 5).Value < "" Then mystartrow = mystartrow + 1 End If Loop Sheet1.Unprotect "protection" Sheet1.Cells(mystartrow, 5) = (Now()) btn_start.Enabled = False btn_end.Enabled = True Sheet1.Protect "protection" End Sub Private Sub btn_end_click() myendrow = 11 Do While Sheet1.Cells(myendrow, 6).Value < "" If myendrow = 35 Then Exit Sub End If If Sheet1.Cells(myendrow, 6).Value < "" Then myendrow = myendrow + 1 End If Loop Sheet1.Unprotect "protection" Sheet1.Cells(myendrow, 6) = (Now()) btn_end.Enabled = False btn_start.Enabled = True Sheet1.Protect "protection" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Shared workbook-header not working | Excel Discussion (Misc queries) | |||
Some macros not working on shared workbook | Excel Discussion (Misc queries) | |||
Macro Not working in Shared workbook | Excel Programming | |||
VBA Code not working on Shared Workbook | Excel Worksheet Functions | |||
Shared Workbook not working | Excel Discussion (Misc queries) |