View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel[_810_] joel[_810_] is offline
external usenet poster
 
Posts: 1
Default Accessing Worksheet stored within Power Point


I assume you used PasteSpecial to put the chart into Power Point as an
excel object so the chart is an ActiveX object.

1) When using one office product in another office product you need to
add the reference library to the VBA application to be able to use all
the commands.

From Power Point VBA menu

Tools - References - Microsoft Excel XX.X objct Library

Make sure you check the box next to the objet and press the OK button

2) Here is some code to get you started.


Sub test()

Dim Excelbk As Excel.Workbook
Dim Excelchart As Excel.Chart

Set Myslide = ActivePresentation.Slides(1)
For Each myshape In Myslide.Shapes
Set Excelbk = myshape.OLEFormat.Object
Set Excelchart = Excelbk.ActiveChart
Next myshape


End Sub

If you get an error in the above code verify the Reference is checked
in the VBA menu.


Once you have the excel chart you should be able to use the object like
any excel chart. Chart are hard objects to work with and should refer
to a specific forum on excel charts for help. I've done a good number
of macros using excel charts and still have trouble get the exact
syntax. I usually refer back to one of my old macros for charting when
I run into problems.


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=188903

http://www.thecodecage.com/forumz/chat.php