Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Superscripting in Powerpoint

Status
Not open for further replies.

karls123

Programmer
Joined
Jan 23, 2006
Messages
6
Location
CA
Does anyone know how to Superscript part of a datalabel in PowerPoint from Excel VBA.

The following code works.

With oGraph.SeriesCollection(rowX)
For colY = 1 To .Points.Count
.Points(colY).DataLabel.Caption = .Points(colY).DataLabel.Caption & "ABC"
Next
End With

But I am unable to Superscript the "ABC".
 
Have you tried to play with the Font property ?
.Points(colY).DataLabel.Font.Superscript = True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, but I only want ot superscript the ABC part of the datalabel.

.points(colY).datalabel.font.superscript=true will superscript the entire datalabel
 
And something like this (typed, untested)?
Dim intLen As Integer
For colY = 1 To .Points.Count
With .Points(colY).DataLabel
intLen = Len(.Caption)
.Caption = .Caption & "ABC"
.Characters(intLen + 1, 3).Font.Superscript = True
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
OOps, hit submit too fast :~/
And something like this (typed, untested)?
Dim intLen As Integer
For colY = 1 To .Points.Count
With .Points(colY).DataLabel
intLen = Len(.Caption)
.Caption = .Caption & "ABC"
.Characters(intLen + 1, 3).Font.Superscript = True
End With
Next

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks, but I have tried the .Characters and I get the following error:

Object doesn't support this property or method.
 


This works...
Code:
    With ActiveSheet.ChartObjects(1).Chart.SeriesCollection(1)
        For Each pnt In .Points
            With pnt.DataLabel
                .Characters(Len(.Caption) - 2, 3).Font.Superscript = True
            End With
        Next
    End With

Skip,

[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue]
 
I can get it to work in Excel using the .Characters property. But when I try to get it to work in PowerPoint I get the error.
 


Have you set a reference for the MS Excel n.m Object Library in Tools/References?

Skip,

[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue]
 
The MS Excel 11.0 Object Library reference was already set.
 


...and you created an Excel Application object in the PP VB Project, using the CreateObject method?

Skip,

[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue]
 
no it uses the MSGraph.Chart within PowerPoint
 


Why are you using MSGraph? It's klunky. As you already stated, you have a reference set for Excel, Excel Chart is much richer in features and capabilities.

I can do the substring superscript in Excel Chart but not in MSGraph.

Pic yer poison.

Skip,

[glasses] [red]Be Advised![/red] For those this winter, caught in Arctic-like calamity, be consoled...
Many are cold, but few are frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top