Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Excel page setup by macro

I need to set the page orientation in Excel printout to Landscape from QV macro. Tried ActiveSheet.PageSetup.Orientation=xLandscape - it doesn't work. The error is in PageSetup.Orientation, apparently QV vbscript doesn't like the Orientation part.
Anyone knows what can be used instead?

Thank you.

1 Solution

Accepted Solutions
Not applicable
Author

Found this elsewhere in the forum: XLsheet.PageSetup.Orientation = 2 'Landscape

You might want to give it a go (I haven't the time to test)

View solution in original post

4 Replies
Not applicable
Author

Try Orientation = xlLandscape (untested)

Anonymous
Not applicable
Author

Thanks DK_ASN,
Actually this is exactly what I tried and what didn't work - sorry for mistyping in my opening post. It was Orientation = xlLandscape.

Not applicable
Author

Found this elsewhere in the forum: XLsheet.PageSetup.Orientation = 2 'Landscape

You might want to give it a go (I haven't the time to test)

Anonymous
Not applicable
Author

This is exactly what I'm looking for - thanks!