Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Accessing PowerPoint datalabels from excel VBA

Is there any way I can change font size/ color of my
datalabels in PowerPoint using my Excel vba program?

Many thanks
KD
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Accessing PowerPoint datalabels from excel VBA

Well, I learned something off this site just the other day that helped me with that same kind of thing

'***First, you'll need to go to the tools menu in VBA for excel and choose References. In that huge list find Microsoft PowerPoint 9.0 Object Library and mark it. (Also mark the Microsoft 9.0 Object library if it isn't already)

'***Next, you create a powerpoint object (or however you say it) with the following code in your sub
Dim oPpoint As PowerPoint.Applicatio
On Error Resume Nex
Set oPpoint = GetObject(, "PowerPoint.Application"
On Error Resume Nex

'***If the file is not open, you can use this code to open it
If oPpoint Is Nothing The
Set oPpoint = CreateObject("PowerPoint.Application"
oPpoint.Activat
oPpoint.Visible = Tru
End I
oPpoint.Visible = msoTru
On Error Resume Nex

With oPpoin
.Presentations.Open Filename:="put the path to the file here", ReadOnly:=msoTru

End Wit

'***Next, if you want to access a text box in the presentation, use the following code
With oPpoin
.ActiveWindow.Selection.SlideRange.Shapes("name of the box here").Selec
End Wit
'*and to find the name of the text box, I usually go to power point and tell it to record a macro, where I just select the box and then stop the macro and look at the code it wrote for me

'***Next, to change anything to do with the font, use the following code
With ActiveWindow.Selection.TextRange.Fon
.Name = "Times New Roman
.Size = 2
.Bold = msoTru
.Italic = msoTru
.Underline = msoFals
.Shadow = msoFals
.Emboss = msoFals
.BaselineOffset =
.AutoRotateNumbers = msoFals
.Color.SchemeColor = ppForegroun
End Wit

Hope this help

Joe B.
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
Automatic location and order of DataLabels? tskogstrom Charts and Charting in Excel 1 November 11th 06 08:53 PM
Eliminate DataLabels upon eachother not readable? Marie J-son Charts and Charting in Excel 0 March 1st 06 05:37 AM
Lock the chart but leave datalabels position editable Joy Charts and Charting in Excel 1 June 13th 05 08:21 PM
Datalabels on Scatter Daniel Bonallack[_2_] Excel Programming 1 September 15th 03 10:23 PM
Converting DataLabels to Numbers Dan Gesshel Excel Programming 1 August 1st 03 04:34 AM


All times are GMT +1. The time now is 06:13 AM.

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"