I have a sub that dynamically sets the print area of an Excel sheet. It works perfectly when I run it from the VB editor. I set it up to be run by a function so that I can use it as a macro. I can run the function which runs the sub in the editor and it works fine. When I setup the macro to run it halts. The only message I get is action failed. I did have problems with the sub leaving an Excel process running and have added an End statement to the procedure which fixes the hanging process but seems to cause the macro to halt. If I take the end out, the macro runs but an Excel process is left running. Has this happened to anyone else? Thanks in advance for any ideas.