



Hey all,
I am trying to create some python code to edit embedded ppt slides and need some help.
import win32com.client
from win32com.client import constants
import re
import codecs,win32com.client
import time
import datetime
import win32com.client.dynamic
######################################################
############ VARIOUS VARIABLES TO SET ################
path = "C:\temp/"
######################################################
######################################################
PPT=win32com.client.Dispatch("PowerPoint.Application")
WB=PPT.Presentations.Open(path + "File.ppt")
PPT.Visible=1
PPTSLIDE= 29
for Z in WB.Slides(29).Shapes:
if (Z.Type== 7):
ZZ=Z.OLEFormat.Object
WSHEET = ZZ.Worksheets(1)
WSHEET.Range("A1").Value = .50
Gives error:
Traceback (most recent call last):
File "P:\Burke\TRACKERS\Ortho-McNeil\04 2007, 04-10 WAVE 4\Automation\Document1.py", line 23, in ?
WSHEET = ZZ.Worksheets(1)
File "C:\Program Files\Python\lib\site-packages\win32com\client\dynamic.py", line 489, in __getattr__
raise AttributeError, "%s.%s" % (self._username_, attr)
AttributeError: .Worksheets
Tool completed with exit code 1
Anyone worked with PPT embedded sheets and what why this is bombing out?
Thanks in advance,
Lance