Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get page orientation of active sheet in Excel 2007
If a chart is selected in Excel 2007, using
ActiveSheet.PageSetup.Orientation doesn't seem to return the orientation of the active sheet, but the orientation of the selected chart object (whatever the meaning of this value is...?). Is there another way to return the orientation of the active sheet (if not programmatically unselect the chart shape first)? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get page orientation of active sheet in Excel 2007
doesn't work either... :(
Tom Ogilvy wrote: What do you get with activesheet.name? Dim sh as Worksheet set sh = worksheets(Activesheet.name) msgbox sh.pagesetup.orientation of course, you don't need to select the chart to work with it. activesheet.chartobjects(1).Select |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get page orientation of active sheet in Excel 2007
Sub ABCD() Dim obj As Object Set obj = Selection Do While TypeName(obj) < "Worksheet" Set obj = obj.Parent Loop MsgBox obj.PageSetup.Orientation End Sub -- Regards, Tom Ogilvy "Luca Brasi" wrote: doesn't work either... :( Tom Ogilvy wrote: What do you get with activesheet.name? Dim sh as Worksheet set sh = worksheets(Activesheet.name) msgbox sh.pagesetup.orientation of course, you don't need to select the chart to work with it. activesheet.chartobjects(1).Select |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Get page orientation of active sheet in Excel 2007
Unfortunately no.
There's no problem to get the reference to the active worksheet. The ActiveSheet property does this correctly. But if a chart is selected on this sheet, ActiveSheet.PageSetup.Oriention does not return the orientation of this sheet, but the orientation of the selected chart object (whatever that means). The same for PaperSize. Thanks for your help anyway. Tom Ogilvy wrote: Sub ABCD() Dim obj As Object Set obj = Selection Do While TypeName(obj) < "Worksheet" Set obj = obj.Parent Loop MsgBox obj.PageSetup.Orientation End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Changing Page Orientation in Excel 2007 | Excel Discussion (Misc queries) | |||
Excel 2007 page orientation button not working | Setting up and Configuration of Excel | |||
Excel Page orientation | Excel Worksheet Functions | |||
what is the page orientation in Excel and how do you change it? | New Users to Excel | |||
mso-page-orientation asp excel | Excel Programming |