File Exchange
Try Origin for Free
The Origin Forum
Home
|
Profile
|
Register
|
Active Topics
|
Members
|
Search
|
FAQ
|
Send File to Tech support
All Forums
Origin Forum for Programming
Forum for Python
Updating Origin OLE in a PowerPoint File(pywin32)
Note:
Only the poster of this message, and the Moderator can edit the message.
Screensize:
640 x 480
800 x 600
1024 x 768
1280 x 1024
UserName:
Password:
Anti-Spam Code:
Format Mode:
Basic
Help
Prompt
Format:
Font
Andale Mono
Arial
Arial Black
Book Antiqua
Century Gothic
Comic Sans MS
Courier New
Georgia
Impact
Lucida Console
Script MT Bold
Stencil
Tahoma
Times New Roman
Trebuchet MS
Verdana
Size
1
2
3
4
5
6
Color
Black
Red
Yellow
Pink
Green
Orange
Purple
Blue
Beige
Brown
Teal
Navy
Maroon
LimeGreen
Forum:
Forum for Python
Subject:
Message:
* HTML is OFF
*
Forum Code
is ON
Smilies
Origin Ver. and Service Release (Select Help-->About Origin): origin2023 Operating System: windows, pycharm Hi, I really need your help. I would greatly appreciate any advice you can give. I am trying to sequentially open multiple Origin OLE objects embedded in a PowerPoint slide and automatically update the worksheets originally inside each object, but I am facing an issue. When multiple OLE objects are open, op.find_sheet only calls the first opened OLE object, so I cannot update the next one. I tried using op.utils.exit to close the first OLE object and then reconnect the application with op.attach() to update the next OLE object, but I am unable to establish the connection to the application. The approximate code is as follows: import os import win32com.client import originpro as op powerpoint = win32com.client.Dispatch("PowerPoint.Application") powerpoint.Visible = True origin = win32com.client.Dispatch("Origin.ApplicationSI") origin.Visible = True for slide_index, slide in enumerate(presentation.Slides) for shape_index, shape in enumerate(slide.Shapes): ole_name = shape.Name if "origin" in ole_name.lower(): shape.OLEFormat.DoVerb(1) wks = op.find_sheet('w', 0) wks.from_df(data) shape.OLEFormat.DoVerb(0) op.detatch() op.utils.exit() op.attach() presentation.Save() presentation.Close() powerpoint.Quit() op.exit() sng
Check here to subscribe to this topic.
The Origin Forum
© 2020 Originlab Corporation
Snitz Forums 2000