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
 Origin Forum
 From Origin to Excel
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Luft

Brazil
2 Posts

Posted - 09/28/2011 :  4:45:23 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
Operating System: Windows XP

Hi guys,
I work with spectroscopy and the equipment saves the data in Origin format. Therefore, what I have is a .prj file with several workbooks.
Until now, I am exporting the data manually: I simply copy the data from each workbook to an Excel sheet.
I would like to export all the workbooks to excel or to matlab automatically.
I tried the matlab console, but as far as I know, I have to export each workbook separately. As I have more than 100 workbooks in one project, it is a lot of work.
Does anyone know how to do it?

Thanks a lot for helping me.

Luciane.

greg

USA
1378 Posts

Posted - 09/29/2011 :  3:13:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
In order to do this automatically, you would have to do some programming.
Using Origin as the Client, you could write a program using Excel as a Server.
In pseudocode, it would look like

// For each Workbook
doc -e W {
pseudoStartExcel;
// For each Sheet in Workbook
for(iSheet = 1; iSheet <= page.nlayers ; iSheet++)
{
page.active = iSheet;
psuedoAddExcelSheetIfNotAlready;
pseudoCopyDataFromOriginToExcel;
}
psuedoSaveExcelAndClose;
}

See ..\Samples\COM Client\MS Office\ExcelImport.OPJ for an example of Origin using Excel as a COM Server.

Using Excel as the Client, you could write VBA code to open OPJ files and copy the data. The above pseudocode would still be a good starting point since it outlines how to quickly get through all workbooks in a project.
See the examples in ...\Samples\Automation Server\Excel
Go to Top of Page

Luft

Brazil
2 Posts

Posted - 09/29/2011 :  3:18:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Greg,
thanks for your help.
I will try to do it.

Luciane.
Go to Top of Page

66de250

China
11 Posts

Posted - 06/04/2024 :  10:59:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hello! Did you solve the problem? I had a similar problem.
Go to Top of Page

snowli

USA
1379 Posts

Posted - 06/04/2024 :  2:36:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We support export a multi-sheet workbook into a multi-sheet excel file
https://www.originlab.com/doc/en/Origin-Help/Export-Wks-Mat#Exporting_worksheet.2Fworkbook_as_Excel_file
With workbook active, choose File: Export: Excel.
Set Export Sheets: as Whole Book.

Before you click OK, u can click the > button next to Dialog theme and choose Generate Script to dump the associated script.

Then if you put it inside doc -e W{ } to loop though all books, it will create multiple excel files for each book.

E.g. try
doc -e W {
expXLS path:="<User Files Folder>" sheets:=whole;
}

Thanks, Snow
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