Error 1004 for PaperSize Property

c_dewitt

New Member
Joined
Sep 18, 2007
Messages
4
I have a short piece of vba that includes

With ActiveSheet.PageSetup
.
.
.
.PaperSize = xlPaper11x17
.
.
.
End With

It ran a few times when I was debuging but then I closed the vba editor and ran if from a toolbar button and I get

Error 1004 Unable to set the PaperSize Property of the PageSetup Class

It's done this ever since. If I comment out the .PaperSize = xlPaper11x17 it works fine.

The default printer is a big copier that handels A, B and legal paper and there are several other printers installed including pdf printers so it's not like it can't be printed on installed hardware.

Any ideas?

Thanks,

C DeWitt
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Hi,

I'm not sure - but what happens if you replace ActiveSheet with the name of the sheet i.e. Sheets("Sheet1")?
 
Upvote 0
How odd, I changed it to use the sheet name and it works. So why did it decide to pick on sheet size and not the rest?

It's a mystery!

Thank you for the suggestion

C DeWitt
 
Upvote 0

Forum statistics

Threads
1,213,536
Messages
6,114,215
Members
448,554
Latest member
Gleisner2

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