View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Graham H Graham H is offline
external usenet poster
 
Posts: 56
Default Excel 2007 print problem

Hi Pascal,
Thanks for reply. This occurs when the procedure with a de-bug window which
says 'PrintArea' of object 'PageSetup' failed. As I said it works perfectly fine in Exccel
2002, I just wondered what modification was required for 2007.The code it is included in is
ActiveWindow.SelectedSheets.PrintOut Copies:=1
Cells.Select
ActiveSheet.PageSetup.PrintArea = Selection.Address
Range("A1").Select
Sheets("Commands").Select


Thanks for your comments.

Graham

papou wrote:
Hello Graham

There's obviously some hiccup with Selection.Address in your code.
What is the error message?
Does your selection contain any object?
Try and get what Selection.Address actually returns, for instance:
Debug.Print Selection.address
or
Msgbox Selection.Address

Cordially
Pascal

"Graham H" a écrit dans le message de news:
...
Using a procedure which was originally created in Excel 2002 I am getting
an error at the following line when running the same procedure on Excel
2007.

ActiveSheet.PageSetup.PrintArea = Selection.Address

I am at a loss as to why it comes out at this point and would value any
guidance.

Graham