Author |
Topic |
|
millot.marius
USA
38 Posts |
Posted - 11/09/2016 : 4:48:46 PM
|
Origin Ver. and Service Release (Select Help-->About Origin): 2016 b9.3.1.273 Operating System:win 7 on virtual machine
Hi Is there a better way to export a whole workbook to a multitab excel spreadsheet than exporting each worksheet to csv ? |
|
Hideo Fujii
USA
1582 Posts |
Posted - 11/10/2016 : 12:34:06 PM
|
Hi millot.marius,
Could you please try the following script?:
////////////////////////////////////////////////////
nl=page.nlayers; //number of sheets
iw$=%H; //Input wkbook
Menu -e 34024; //Create an Excel wkbook
ox$=%H; //output wkbook
for(ii=1; ii<=nl; ii++) {
window -a %(iw$); //Activate input wkbook
wrcopy iw:=[%(iw$)]$(ii)! ow:=[%(ox$)]$(ii); //Copy wksheet
}
//////////////////////////////////////////////////// which creates a new Excel workbook, data copied from the original Origin workbook, within the Origin project. Then, you can change this Excel workbook as "External" by right-clicking the title bar, and select Properties (or, by saving the Excel book by right-clicking the title bar, and choose Save As).
Hope this works.
--Hideo Fujii OriginLab |
|
|
millot.marius
USA
38 Posts |
Posted - 01/04/2017 : 6:28:43 PM
|
Hi
This works great, thank you
Would it be possible to optionally copy the longname column headers as the first row in the excel file, and to rename the Excel wksheet as the corresponding Origin worksheets ? |
|
|
Hideo Fujii
USA
1582 Posts |
Posted - 01/05/2017 : 3:28:22 PM
|
Hi millot.marius、
You can add "label:=1" option of the wrcopy x-function in the For loop such as:
wrcopy iw:=[%(iw$)]$(ii)! ow:=[%(ox$)]$(ii) label:=1; though in a more general way, this outputs not only Long Name row, but also Units and Comments rows. http://www.originlab.com/doc/X-Function/ref/wrcopy
I hope this is okay.
--Hideo Fujii OriginLab |
|
|
millot.marius
USA
38 Posts |
Posted - 01/05/2017 : 5:16:15 PM
|
Thanks! |
|
|
ben.adam
USA
7 Posts |
Posted - 01/13/2017 : 7:47:58 PM
|
It seems this does not work for earlier versions of Origin? I tried it for version 9 and did result in one new excel sheet and a whole number of normal origin workbooks being opened. Is there another way for earlier Origin version to achieve the same result?
Thanks
Ben Adam
Benjamin Adam Portland State / Oregon State University Materials Engineering |
|
|
Hideo Fujii
USA
1582 Posts |
Posted - 01/16/2017 : 3:46:48 PM
|
Hi Ben Adam,
Sorry, but I don't know why the script didn't work on your machine. As far as I tested in Origin 9.0 SR2, it worked. Please make sure that Excel has been already installed in your machine to run it.
--Hideo Fujii OriginLab
|
|
|
|
Topic |
|