Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro's doesn't work (in potected Sheets)

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Macro's doesn't work (in potected Sheets)

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


  #3   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Macro's doesn't work (in potected Sheets)

Rudd
If you wih to do a bulk protection (ie all worksheets in workbook) you may try:

Sub protectmysheets()
Dim Ws As Worksheet
For Each Ws In Worksheets
Ws.Protect
Next Ws
End Sub

Sub unprotectmysheets()
Dim Ws As Worksheet
For Each Ws In Worksheets
Ws.Unprotect
Next Ws
End Sub

HTH
Cordially
Pascal
"Ruud" a écrit dans le message de ...
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
work sheets James Excel Discussion (Misc queries) 2 January 8th 09 04:55 PM
Macro's not appearing in new spread sheets Jimmy Jones Setting up and Configuration of Excel 0 October 30th 07 05:09 PM
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
Counting dates in multiple work sheets and work books Savage Excel Discussion (Misc queries) 0 December 19th 05 11:41 PM
I wish to save my Excell work in my work sheets CLC 37 Qld Excel Worksheet Functions 0 May 24th 05 10:56 AM


All times are GMT +1. The time now is 11:08 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"