Reputation: 8548
I would like to write a module in Matlab for writing to an excel file. I am using Openoffice in Windows Vista.
I have a module which would work with Microsoft excel, since I donot have Microsoft office, it would throw an exception.
Here is the Matlab code segment which I would like to change to work for openoffice
Excel = actxserver ('Excel.Application');
This code segment is throwing an exception. Any idea how to change the code to work for open office?
I am not familiar with the Matlab API's that I need to use to read/write excel files
Upvotes: 2
Views: 2273
Reputation: 5251
As @Joey says, you need to re-write all of the excel-related code in order to get Excel to create the XLS file. If you need to write something that allows you to switch between Excel and OpenOffice depending on what is installed, then I would do it using the MATLAB OOP features by creating an abstract base class that implements the process and deriving classes to wrap the Excel- and OOO-based low-level commands.
Upvotes: 1
Reputation: 354834
That's not exactly Matlab's doing there. You're creating an Excel ActiveX object and create the file through that. The result is that Excel itself is writing the file as you're only controlling Excel.
OpenOffice seems to allow something similar, even though ActveX. Here is an introduction. But you likely have to re-create all code that creates the file from scratch, as the APIs are incompatible.
Upvotes: 1