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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Setting the formular/equationof a column.

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
hschausb Posted - 02/22/2021 : 2:38:03 PM
Operating System: 2020B

Dear fellow programmers.

It seems I cannot find the correct command to set the formular/equation of a column.
I locked in the guid and googled it. But no luck. It is highly possible I am using the wrong key words to search for this. So would anybody be so kind and tell me the command?

I am looking for “wks.Column(n).XXXX;” if that is right.

Thank you very much.
3   L A T E S T    R E P L I E S    (Newest First)
rapt1 Posted - 03/18/2021 : 1:22:43 PM
Hi,

Worksheet wks =...;
int iCol=....;

wks.Columns(iCol).SetFormula("col(a)+col(b)*5", AU_AUTO);
wks.Columns(iCol).ExecuteFormula();



D

win10
OriginPro 2021 (64-bit)
9.8.0.200
cpyang Posted - 02/24/2021 : 2:09:42 PM
Someone else actually asked about this exact something and we have made it work in the upcoming Origin 2021b, so if you want, you can request a beta, see code below:

void scv(int nCol = 1, string formula="A+1")
{
	Worksheet wks = Project.ActiveLayer();
	Column aa = wks.Columns(nCol);
	aa.SetProp("Formula", formula);
}


CP
YimingChen Posted - 02/24/2021 : 10:02:33 AM
Try this X-function in Labtalk:
https://www.originlab.com/doc/X-Function/ref/csetvalue

James

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000