Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Page Orientation in Excel 2007 Denver Excel Discussion (Misc queries) 2 July 13th 10 11:12 AM
Excel 2007 page orientation button not working ChapelHillGirl61 Setting up and Configuration of Excel 0 February 12th 09 11:51 AM
Excel Page orientation Sam Excel Worksheet Functions 1 August 1st 08 09:14 PM
what is the page orientation in Excel and how do you change it? TDWilliams New Users to Excel 1 June 11th 05 02:30 AM
mso-page-orientation asp excel avs Excel Programming 0 October 23rd 03 04:01 PM


All times are GMT +1. The time now is 06:48 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"