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
 LabTalk Forum
 import excel file and plot a graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

nilo

5 Posts

Posted - 04/04/2012 :  10:25:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

nilo

5 Posts

Posted - 04/10/2012 :  09:50:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

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.
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