Problem with PrintArea property

U

Ugleeduck

Hello All,

Thanks in advance for reading my post. I want to give users the
ability to print a certain range via a macro. After selecting teh
range, the user should be able to click one button to print (instead
of going through File-Print Area....).

I have a very simple VB macro for this. Problem is, everytime I run
it, I get get an error saying Object doesn't support the property.
Here's the code snippet. Any help will be greatly appreciated.


Public Sub AreaPrint()
ActiveSheet.PageSetup.PrintArea = _
ActiveWindow.Selection.Address

ActiveSheet.Selection.PrintPreview
Unload Me

End Sub


If I comment out the print preview part and print directly, it works
fine.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top