View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default 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