PC Review


Reply
Thread Tools Rate Thread

Callouts in 2007

 
 
forRobertM
Guest
Posts: n/a
 
      25th May 2010
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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to anchor callouts? CompleteNewb Microsoft Excel Discussion 0 11th Oct 2010 09:22 PM
Callouts in PowerPoint 2007 Martin S Williams Microsoft Dot NET 1 11th Feb 2010 03:22 PM
Disappearing text in Callouts Excel 2007 Sue Microsoft Excel Worksheet Functions 1 10th Mar 2009 06:36 PM
callouts greg Microsoft Excel Discussion 3 27th Feb 2007 06:53 PM
Callouts Steve N Microsoft Powerpoint 1 11th Nov 2003 10:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:44 PM.