Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatic location and order of DataLabels? | Charts and Charting in Excel | |||
Eliminate DataLabels upon eachother not readable? | Charts and Charting in Excel | |||
Lock the chart but leave datalabels position editable | Charts and Charting in Excel | |||
Datalabels on Scatter | Excel Programming | |||
Converting DataLabels to Numbers | Excel Programming |