T O P I C R E V I E W |
Luft |
Posted - 09/28/2011 : 4:45:23 PM 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.
|
4 L A T E S T R E P L I E S (Newest First) |
snowli |
Posted - 06/04/2024 : 2:36:19 PM 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 |
66de250 |
Posted - 06/04/2024 : 10:59:57 AM hello! Did you solve the problem? I had a similar problem. |
Luft |
Posted - 09/29/2011 : 3:18:44 PM Hi Greg, thanks for your help. I will try to do it.
Luciane. |
greg |
Posted - 09/29/2011 : 3:13:11 PM 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 |
|
|