Author |
Topic  |
|
nilo
5 Posts |
Posted - 04/04/2012 : 10:25:25 AM
|
Origin Ver. and Service Release (Select Help-->About Origin): 7.5 (or 8) Operating System: Win XP
Hi, I've never program with origin but I'd like to automatize operations I'll do on several files.
I want to import excel file as new workbook, rename workbook with the filename, add a column to make calculation inside, plot a graph with two layers (and using my template) and add the workbook name on the graph.
I don't know how to start. I've tried several things but depending on the version (7.5 or 8) sometimes part is working, sometimes nothing...
Thanks for your help |
|
Laurie
USA
404 Posts |
Posted - 04/04/2012 : 11:54:23 AM
|
The following will work in version 8 or later:
To import Excel, please use the impExcel x-function. This function has import options that you can set to rename the workbook with the filename.
To add a column: wks.addcol()
To plot data, use the plotxy x-function.
To add the workbook name to the graph, you could edit the legend. To do this, select Graph:Update Legend. Set 'Auto Legend Translation Mode' to Custom and then enter a custom format of @W. This change is saved when you save the graph as a template. You can also create another text label with this @W. Let me know if you need an example. Text labels are saved as part of graph templates.
OriginLab Technical Support |
 |
|
nilo
5 Posts |
Posted - 04/10/2012 : 09:50:31 AM
|
Hi,
Thanks a lot for your help. I'm now working on Origin 8.6 (which look very nice).
what I did to import my file and plot it:
fname$="C:\vds-id-20-a.xls"; impExcel cell:=0 sname:=1 d:=NN; plotxy ((5,4),(5,9),(5,14),(5,19),(5,24),(5,29)) plot :=202 ogl:=[<new template:="C:\IdVd1.otp" name:="W">]
How can I do this sequence for all the files "vds-ids*.xls" ? How can I limitate the number of empty columns to 1 for each sheet ? (I tried emptycols:=1 unsuccessfully…) Can I rename the graph with the filename (or bookname) ? How can I apply a theme to the graph ? I tried themeApply2g but It's not working with my theme or maybe I used a wrong sentence(C:\IdVd.oth). Otherwise I'll use themeApply2g -d on the folder.
I know it's a lot of questions but It's really new for me. Thank you for your time.
|
 |
|
|
Topic  |
|
|
|