Read/Write Excel Files on OS X?

Sorry for the straightforward newbie question. I have a need to read and write Excel files on both Windows and OS X. One of the reasons I’m considering Xojo is the cross-platform features, and writing applications that can read/write Excel files is critical. I can certainly do this with Perl using a library. Is this possible with Xojo, natively? Is this functionality planned?

You may want to check the MBS Xojo XL Plugin:

We can read/write old/new Excel files without Excel installed.

at the bottom of the page :

Thanks. So, again, it appears that Xojo can’t do this natively. I don’t want to pay extra for a plug-in to read and write Excel format.

Neither does VB.Net
You use the COM components from MS Excel

Well, the question is what you rally want and what compromises you want to accept.

Mac? Win?
With excel installed or not?

just simple things or specials like creating formats, cells with formulas or add images?

What I do is read values from an Excel spreadsheet and write values and formats to an Excel spreadsheet. With or without Excel installed.

I can do this with Java or with Perl on Windows or Mac. I’m just trying to see if Xojo will provide the same flexibility?

[quote=256188:@Joe Blaty]
I can do this with Java or with Perl on Windows or Mac. I’m just trying to see if Xojo will provide the same flexibility?[/quote]
Neither of those have this “built in”
It’s an add on library / package for both from some third party
That its free is an entirely different matter

Christians MBS plugin is based on libXL which is a commercial solution
So the plugin costs money

There are some classes available to write Excel spreadsheets around - none that read them in pure Xojo code
Not that it would necessarily be impossible just its a huge undertaking to write a read for docx, and xmlx file formats
And no one has done such a thing and made it available for free

And if you wanted you COULD call into perl or java from Xojo and use those mechanisms to grab whatever data & put a nice UI on things

MBS has Java classes :slight_smile:

Thanks! I’m trying to find a tool that I can use for cross platform development at low cost. While I certainly appreciate that commercial solutions take time and effort to build and maintain, I can’t consider the personal expense to get this additional functionality. I’ll keep on searching.

Writing is the easy part :stuck_out_tongue:
Loading & reading an excel spreadsheet is much more difficult
BUT you COULD call from Xojo into perl, php , java etc and go that route

I did the reading part and did not find that difficult for xlsx files.
I can open the xlsx file (its a zip file with xml text files inside after all)
then i convert it into an in-memory sqlite database
and I can read xlsx files to import it in another big database.
I will write the “writing” part when I need it but it seems not difficult too
I gave you 2 links before, with FREE examples to let you start writing your own class and methods.

another way to read simple data tables from excel files is by using the Xojo ODBCDatabase plugin and an appropriate ODBC driver for Excel for the platform you are on.

yes but they are not free too …

The ODBCDatabase plugin comes with Xojo. It is in the Extras/Database PluginResources folder.

again yes, but the excel odbc plugin ( for mac) is not free if I remember correctly …

BTW, on the Mac side one could use AppleScript to perform many of the tasks that the COM interface offers on Windows, I guess. So, if one writes some classes that handle COM and AS calls on those platforms transparently, then one would have a cross-platform solution. For “free” (if one doesn’t count all the work involved).

won’t you NEED excel installed to do applescript with sheets on the mac ?

Yes, you would. Same for the COM API, I believe. I have not followed the discussion in detail. Was that a requirement that he wants it to work without Excel being installed? I was just jumping in because no one brought using AppleScript up, yet.