Macros

  • Thread starter Thread starter shanmugaraj
  • Start date Start date
S

shanmugaraj

Hi,

I want the data in the excel sheet to be generated as a chart in th
powerpoint using macros

When you press the command button in the excel sheet the powerpoin
should update the chart in the slide.

:confused
 
Here's some sample code from Excel 97's SAMPLE.XLS workbook. It might give
you a start.

Sub MS_PowerPoint()
Dim ppt As Object, pres As Object
'Create a Microsoft PowerPoint session
Set ppt = CreateObject("powerpoint.application")
'Copy the chart on the Chart Labels sheet
Worksheets("Chart Labels").ChartObjects(1).Copy
'Make PowerPoint visible
ppt.Visible = True
'Activate PowerPoint
AppActivate ppt.Name
'Open a new document in Microsoft PowerPoint
Set pres = ppt.Presentations.Add
'Add a slide
pres.Slides.Add 1, ppLayoutBlank
'Paste the chart
ppt.ActiveWindow.View.Paste
Set ppt = Nothing
End Sub

--
Regards
Andy Wiggins
www.BygSoftware.com
Home of "Save and BackUp",
"The Excel Auditor" and "Byg Tools for VBA"
 
Back
Top