View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Hakyab Hakyab is offline
external usenet poster
 
Posts: 21
Default Accessing Worksheet stored within Power Point

Many thanks Joel. Your version did not work, but I got it done still due to
your pointers. I guess I should have mentioned that I use 2007, and the chart
I pasted did not appear as an OLE object, OLEFormat method gave an error. In
the end, the following worked:

Set ch2 = ActivePresentation.Slides(2).Shapes(2)
Set wk = ch2.Chart.ChartData.Workbook
With wk.ActiveSheet.Range("Ali")
.Value = .Value + 1
End With

ch2.Chart.Refresh

Cheers,

"joel" wrote:


That is not going to work. The entire workbook is in Power Point and
you are just viewing that chart. Double clik the chart object and you
will get the entire workbook. You have to change the data inside the
Power Point Object. You can change these items inside a macro in Power
Point. that is why I created a variable for the workbook in my macro.
You can access the sheets and the ranges on the sheet using my code

Set Excelbk = myshape.OLEFormat.Object
Excelbk.sheets("sheet1").Range("A1") = 5


--
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

.