Thanks for the reply, but i can't get the line of code below to work.
As shown in the example from the link you provided. Any ideas?
Then in Excel run this: MsgBox PageSetup.PaperSize. This will give you the new constant value assigned to that paper size in Excel. Then change .PaperSize = xlPaperUser in your macro to .PaperSize = & whatever the constant is that you just found.
Code:
Sub AAA()
With ActiveSheet.PageSetup
MsgBox PageSetup.PaperSize
End With
Exit Sub