win32com ppt embedded object numbers reverting back to original numbers - SOLVED

Lance Hoffmeyer lance at augustmail.com
Wed Jul 25 21:45:53 EDT 2007


Hey all,

I solved this problem.  Here is the final version of this def for anyone who
someday may be interested:

def attributesbyID(row,base,slideID,spreadsheet):
	sh = wb.Worksheets (spreadsheet)
	sh.Select()
        LIST = xlparams(row, base)
 	################ POWERPOINT SECTION ######################
	for shape in WB.Slides.FindBySlideID(slideID).Shapes:
		if (shape.Type== 7):
		 	for oXLROW,oXLBASE,oXLLASTCOL,oPPTCELL,oPPTHEADERCELL in LIST:
		 		oVALUE = sh.Cells(oXLROW,oXLLASTCOL).Value
				oHEADER = sh.Cells(base-1,oXLLASTCOL).Value  + " (n="  +  str(int(sh.Cells(oXLBASE,oXLLASTCOL).Value))  + ")"
				PWB = WB.Slides.FindBySlideID(slideID).Shapes(shape.Name)
				oGraph = PWB.OLEFormat.Object
#				oGraph = shape.OLEFormat.Object
				oGraph.Application.datasheet.Range(oPPTCELL).Value = oVALUE
				oGraph.Application.datasheet.Range(oPPTHEADERCELL).Value = oHEADER
				oGraph.Application.datasheet.Font.Bold=False
				oGraph.Application.Update()
				oGraph.Application.Quit()	
				del oGraph



More information about the Python-list mailing list