What line is failing in the code you have now?
If you take out your error check stuff will it properly access the PageSetup object?
>Tried your suggestion. It still failed in my function call passing the object as a parameter. If I performed the logic from my function in the location where I create the object, it works. However, once I try it from a procedure file it fails.