Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
with sheet protection on, macro won't run to add borders around a
If protection is off, the macro runs fine. If the sheet and worksheet
becomes protected, the macro produces a runtime error 1004 that I have no been able to locate how to fix (Visual Basic help was of no help). The debug points to the following: Selection.Borders(xlDiagonalDown).LineStyle = xlNone |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
with sheet protection on, macro won't run to add borders around a
Dim wsh as Worksheet
Set wsh=Selection.Parent wsh.UnProtect "Password" <Perform things on the worksheet wsh.Protect "Password" Replace Password with the password of the sheet that is protected. This password is case sensitive. If there is no password, then omit this argument. -- Ronald R. Dodge, Jr. Production Statistician/Programmer Master MOUS 2000 "Lorrie M" <Lorrie wrote in message ... If protection is off, the macro runs fine. If the sheet and worksheet becomes protected, the macro produces a runtime error 1004 that I have no been able to locate how to fix (Visual Basic help was of no help). The debug points to the following: Selection.Borders(xlDiagonalDown).LineStyle = xlNone |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
with sheet protection on, macro won't run to add borders around a
If you protect the sheet, then just like manually, code can not change the
things that are protected. the work around is to have your code unprotect the sheet, make the change, reprotect the sheet or look at the UserInterfaceOnly property of the protect methods. -- Regards, Tom Ogilvy "Lorrie M" wrote: If protection is off, the macro runs fine. If the sheet and worksheet becomes protected, the macro produces a runtime error 1004 that I have no been able to locate how to fix (Visual Basic help was of no help). The debug points to the following: Selection.Borders(xlDiagonalDown).LineStyle = xlNone |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
with sheet protection on, macro won't run to add borders around a
You can unprotect and re-protect the sheet in the macro. I would tell
you how, but I don't have Excel on the PC I'm writing this on and I don't trust my memory to provide the correct syntax. If you need example code and no one else offers any, reply to this and I'll work something up. (To help with getting a solution: What version of Excel are you using?) Lorrie M wrote: If protection is off, the macro runs fine. If the sheet and worksheet becomes protected, the macro produces a runtime error 1004 that I have no been able to locate how to fix (Visual Basic help was of no help). The debug points to the following: Selection.Borders(xlDiagonalDown).LineStyle = xlNone |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Data Protection Best Practice: AKA: Real Sheet Protection | Excel Discussion (Misc queries) | |||
Excel Data Protection- AKA: Sheet/Macro Password Protection | Setting up and Configuration of Excel | |||
Can a Macro override sheet Protection? | Excel Discussion (Misc queries) | |||
Borders on Excel Sheet | Excel Discussion (Misc queries) | |||
Printing Excel Sheet with borders | Excel Worksheet Functions |