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
 Inserting columns and rows and set recalculation
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

JasonLLL

5 Posts

Posted - 04/26/2022 :  12:42:56 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi

How can I insert new columns and rows via embedded Python?

And can I set the recalculation mode via Python?

Regards
JL


Origin Ver: 2021
Operating System: Windows 10 enterprise

minimax

351 Posts

Posted - 04/27/2022 :  02:21:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I think currently there is no Python function for the operations you need.

So you may have to run Labtalk script like

import originpro as op
wks=op.find_sheet()

#insert a col between A & B, the name "junk" does not matter
wks.lt_exec(r'worksheet -i 1 junk;')

#Insert 5 rows in front of the 3rd row
wks.lt_exec(r'wks.insertrows(3, 5);')

# suppose there is an lock with UID 831, set recalculate mode to be Manual
wks.lt_exec(r'run -au 2 831;')
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