Printing Excel in landscape

MikeFellows

New member
Joined
Jul 28, 2003
Messages
1
Location
Middlesbrough, UK
I have a vb.net app that puts a larga amount of data into an excel spreadsheet. I need to be able to print the document in landscape view and I am unable to do so.

Im currently printingand closing the app using:

excel_app.activeworkbook.printout()
excel_app.ActiveWorkbook.Close(False)


but obviously this only prints in portrait - is there a simple wasy to do this?


Regards

Michael Fellows
 
Try the following:

Private oSht As Excel.Worksheet

oWB is the Excel Workbook that you used to call "printout"
oSht = CType(oWB.ActiveSheet, Excel.Worksheet)

oSht.PageSetup.Orientation = Excel.XlPageOrientation.xlLandscape


Please note that I have not tried this myself, so I am not sure if it will work or not.
 
Back
Top