View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default 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