View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Ruud[_2_] Ruud[_2_] is offline
external usenet poster
 
Posts: 7
Default Macro's doesn't work (in potected Sheets)

Pascal, thanks for your attention,

But I found it, .... it's an Error in Excel !

"Past" will not always work, if it comes directly after "ActiveSheet.Unprotect"
So I put all the unprotect commando's at the start of every macro.
Now it works fine.

BTW... to unprotect all the sheets, will give a lot of commando's
is there not one like
Sheets("sheet1:sheet10").Select
ActiveSheet.Unprotect
Ruud

"papou" wrote in message ...
Hello Rudd
You don't say what your macro does before the lines you mention.
So provided this is the whole code you are using, I would suggest that you can't paste unless you have previously copied.
HTH
Cordially
Pascal
"Ruud" a écrit dans le message de ...
When I protected my sheets.
The macro's will give a lot of Errors, in unprotected mode
the macro's work perfect.

Error section is in bold:

Sheets("Venders").Select
ActiveSheet.Unprotect
Range("E5").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False

Why? what I'm doing wrong?
I changed Paste mode, I checked the space etc.
Thanks for any support
Ruud