The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Python
 how to udate OLE object in powerpoit
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nk.S

Republic of Korea
5 Posts

Posted - 07/08/2024 :  5:59:58 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): origin 2023
Operating System: window10

hi!! please, i need your help!!~~

I'm trying to automate updating ole objects inserted in powerpoint using python.
To roughly explain the process,
1. Open the origin OLE object (1 graph, 1 worksheet, name unknown) inserted into PowerPoint using a win32 module
2. insert the data preprocessed in Python into the worksheet of the ole object.
3. I don't want to change the current graph settings (no rescale), update only the changed data to the graph, save it, and close it.

code is as below, but it's not working, is there a good solution?

--Omit previous code

# Object name in ppt
shape.name = test

# Object execution
ole_object = shape.name.OLEFormat.DoVerb()

# Find the worksheet for the executed object
sheet = op.find_sheet()

# Activate worksheet
sheet.activate()

# insert data
sheet.from_df(data)

# ole_object.Save()
op.utils.exit()

# presentation save and quit
presentation.save()
presentation.close()

sng

YimingChen

1607 Posts

Posted - 07/29/2024 :  11:46:08 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you update the OLE object in PPT by deleting the old one, and paste a new graph object with updated data?

James
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000