A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Callouts in 2007



 
 
Thread Tools Display Modes
  #1  
Old May 25th, 2010, 07:15 PM posted to microsoft.public.excel.charting
forRobertM
external usenet poster
 
Posts: 1
Default Callouts in 2007

Hello,
I have a VB6 app that launches Excel and generates charts. Currently
we use Excel 2003 but the company is finally adopting 2007. Parts of
the chart display as expected, but the callouts do not behave the
same. The following code works fine in 2003, but doesn't work in
2007. (The sub is called AddLegend even though it should be
AddCallout). There is also another code section where the callout is
positioned and the Shape.Adjustments are made to adjust the callout
line length etc.... The idea is that a chart could have multiple
lines on an X-Y Scatter plot and a callout per line would describe the
series.

Private Sub AddLegend(SeriesText As String)
Dim oNote As Excel.Shape
Dim oCallout As Excel.Shape
Dim lChartHeight As Long
Dim lChartWidth As Long

Set oCallout = mChart.Shapes.AddCallout(msoCalloutThree,
mChart.PlotArea.Width, mChart.PlotArea.Top,
UserControl.ScaleX(TextWidth(SeriesText), vbTwips, vbPoints) * 1.5,
UserControl.ScaleY(TextHeight(SeriesText), vbTwips, vbPoints))

With oCallout
.Visible = msoTrue

.Line.Visible = msoTrue
.Line.BeginArrowheadLength = msoArrowheadLong
.Line.BeginArrowheadStyle = msoArrowheadTriangle
.Line.BeginArrowheadWidth = msoArrowheadNarrow

.Callout.Gap = 0

.TextFrame.AutoSize = True
.TextFrame.Characters.Font.Size = 9
.TextFrame.Characters.Text = SeriesText
.TextFrame.AutoSize = False

.Callout.Border = (mBoxBorders = bbNotesAndLegend) 'msoTrue
.Left = mChart.PlotArea.Width - .Width
.Callout.Angle = msoCalloutAngle45
.Callout.AutoAttach = msoFalse


.Line.Style = msoLineSingle
.Line.Weight = 0.25
.Line.ForeColor.RGB = vbBlack
.TextFrame.Characters.Font.Color = vbBlack


End With
End Sub

The main issues are that auto sizing the textframe doesn't work, even
if I try to use TextFrame2, and
the .Callout.Angle = msoCalloutAngle45 line doesn't seem to do
anything.
The Shape.Adjustments don't work either, but I figured those out.
Their problem is that since I can't seem to set the angle to 45
degrees, the lines are all at different angles.

What I would really like is if someone could point me to a resource
along the lines of "you did this in 2003, do this in 2007 to get the
same results."

Thanks,
Robert

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:54 PM.


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