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 Origin C
 Setting the formular/equationof a column.
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hschausb

18 Posts

Posted - 02/22/2021 :  2:38:03 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Edited by - hschausb on 02/22/2021 2:38:30 PM

YimingChen

1592 Posts

Posted - 02/24/2021 :  10:02:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try this X-function in Labtalk:
https://www.originlab.com/doc/X-Function/ref/csetvalue

James
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 02/24/2021 :  2:09:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

rapt1

6 Posts

Posted - 03/18/2021 :  1:22:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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