# Writing Excel on MAC OS X

**URL:** <https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945>\
**Category:** Ruby\
**Created:** [April 5, 2008, 11:38am UTC](https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945 "2008-04-05T11:38:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [April 5, 2008, 11:38am UTC](https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945/1 "2008-04-05T11:38:37Z")

</div>

Hi all,

i’m currently working on an application that exports data and formulars  
as excel sheets. I’m using the WIN32OLE object (library? module?) for  
that.

i am also currently thinking of changing to a Mac for development, but  
even then the application will still run on a windows server for  
production.

Does anyone know, if / how it’s possible to write excel sheets on Mac OS  
X (Tiger / Leopard)?  
Can it still be done with WIN32OLE or do i need another technic (read  
something about parseexcel)  
Would i need MS Office for Mac or does it run with i.e. open / neo  
office?

While googeling, i found this line  
“It may be that microsoft office on the Mac does use COM objects. If  
so, you should be able to use win32ole.”  
So, does anybode know if ms office on mac does use COM objects?

Thanks a lot for any help!

regards  
D.

---

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [April 5, 2008, 1:15pm UTC](https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945/2 "2008-04-05T13:15:51Z")

</div>

Daniel L. wrote:

> So, does anybode know if ms office on mac does use COM objects?

Nope, COM is more or less non-existent on OS X. You can control Mac  
Office applications via AppleScript or any other language that speaks  
Apple events, but that’s all as published APIs go. (Previous versions of  
Mac Office also supported VBA, but that went away in Office 2008.) There  
is a low-level Automation API, which I believe is what REALbasic uses to  
interact with Office apps, but it isn’t publically documented AFAIK. The  
Mac and Win Office codebases are largely independent anyway, so even  
with a cross-platform API you couldn’t be certain that code written for  
one will run on the other without trying it for yourself.

Given that you need to deploy your solution on a Windows server, you’ll  
really have to stick with Windows for developing it too. Though if it’s  
any help, don’t forget that modern Intel Macs can also run Windows using  
either Leopard’s dual-boot support or third-party virtualisation  
programs.

HTH

## has

Control AppleScriptable applications from Python, Ruby and ObjC:  
[http://appscript.sourceforge.net](http://appscript.sourceforge.net)

---

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [April 6, 2008, 3:46am UTC](https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945/3 "2008-04-06T03:46:19Z")

</div>

Why not try NeoOffice/OpenOffice on both the Mac and your Windows  
production server.

Since they are free it would be cheap to try.

You might also find a common API that would give you what you need.

If you have problems, there is an active community that could help with  
hints and tweeks. You then leverage the open source aspect.

Bob G

---

<div class="post-metadata">

**Author:** ![liberte](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/9e8a1a/32.png) [@liberte](https://www.ruby-forum.com/u/liberte)\
**Post date:** [April 7, 2008, 8:30pm UTC](https://www.ruby-forum.com/t/writing-excel-on-mac-os-x/133945/4 "2008-04-07T20:30:57Z")

</div>

Daniel L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Does anyone know, if / how it’s possible to write excel sheets on Mac OS  
> X (Tiger / Leopard)?

Example here:

> **[AppleScript Book Afterthoughts](http://www.apeth.net/matt/aserrata.html)**
>
> Free stuff for learning Cocoa, Frontier, REALbasic, Nisus, HyperCard, Ancient Greek, Latin etc.; my TidBITS software reviews and other writings.

(Scroll all the way to the bottom.)

The example both populates a sheet and creates a chart from that data.

m.
