Dialogbox positioning on chart

User avatar
ErikJan
BronzeLounger
Posts: 1255
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Dialogbox positioning on chart

Post by ErikJan »

I'd like to position a dialogbox with its upper-right corner aligned with the chart upper right corner (so it's visible without overlapping the chart)... The positioning should be dynamic (I select a chart from the dialog and have the chart activated). Charts in this case are not embedded but on their own sheet. I played with activechart.plotarea.top but that's zero...

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dialogbox positioning on chart

Post by HansV »

Perhaps you resized the plot area so that its Top is 0? On a chart sheet, ChartArea.Top will always be 0, but PlotArea.Top depends on the position of the plot area.
x1038.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1255
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Dialogbox positioning on chart

Post by ErikJan »

If I do

Me.Top = ActiveChart.PlotArea.Top

I get 7, the dialog positions relative to the Excel window and therefore the dialog now aligns to the Excel window top and not the plotarea window top (so I'd like to know the absolute position probably)

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dialogbox positioning on chart

Post by HansV »

Not relative to the Excel window, but to the screen, I think.
I can't find out (yet) how to determine the coordinates you want.
Best wishes,
Hans

User avatar
ErikJan
BronzeLounger
Posts: 1255
Joined: 03 Feb 2010, 19:59
Location: Terneuzen, the Netherlands

Re: Dialogbox positioning on chart

Post by ErikJan »

Strange... I've been searching the net for an hour now but find nothing that comes close yet... Again, all I want is that my dialog box is "out of the way" a bit so the user can see the chart underneath

User avatar
HansV
Administrator
Posts: 78549
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Dialogbox positioning on chart

Post by HansV »

The user can do that in much less time than you've spent on it!
Best wishes,
Hans