Why do I keep getting runtime error 450

ghrek

Active Member
Joined
Jul 29, 2005
Messages
426
Hi
I have the following macro and keep getting run time error 450 Wrng number of arguments and invalid prop assignment.

Any Ideas?


VBA Code:
 Sheets("CUBIC MACHINES").Select
    ActiveSheet.Unprotect , Password = "SH"
    Range("A12:M65").Select
    Selection.PrintOut Copies:=2, Collate:=True
     ActiveSheet.Protect , Password = "SH"
    Sheets("Sheet1").Select
    ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True, _
        IgnorePrintAreas:=False
End Sub
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
What lines are causing the problem?
 
Upvote 0
Excel Formula:
ActiveSheet.Unprotect  Password = "SH"
 
Upvote 0
You have a comma that is not needed & also missing a colon after Password parameter

Try deleting the comma & adding the colon & see if resolves.

Rich (BB code):
ActiveSheet.Unprotect , Password:="SH"

Dave
 
Upvote 0

Forum statistics

Threads
1,214,419
Messages
6,119,389
Members
448,891
Latest member
tpierce

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top