View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Disable Button When Worksheet is Locked

Hi

When you say the workshet is locked I assume it is protected.

Worksheets("Sheet1").unprotect Password:="JustMe"
'Your code to mail sheet
Worksheets("Sheet1").Protect Password:= "JustMe"

Regards,
Per

"Gerard Sanchez" skrev i meddelelsen
...

I have a macro that emails the first page of a worksheet from

http://www.rondebruin.nl/mail/folder3/mail4.htm

However, this macro doesn't work if the worksheet is locked.

I was wondering if there is a way for me to make some sort of a button
visual cue (i.e. grayed out) or an error message box to let the user know
he needs to unlocked the worksheet first.

Or on another note, maybe a pie in the sky request, to include within the
macro a code to unlocked worsheet first then lock it back again when email
has been sent.

Thanks