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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
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,215,214
Messages
6,123,664
Members
449,114
Latest member
aides

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