Real Software Forums
http://forums.realsoftware.com/

Using Real Basic to automate Office applications on a Mac
http://forums.realsoftware.com/viewtopic.php?f=13&t=43376
Page 1 of 1

Author:  pvman65 [ Wed Mar 28, 2012 8:16 am ]
Post subject:  Using Real Basic to automate Office applications on a Mac

What is the current status of using Real Basic for automating MS Office applications on a Mac?
I need to extract data from an Excel spreadsheet and insert these in Word templates in order to build Building Blocks for Word.
Both Excel and Word will be running on a Mac.
My development platform is on Windows 7 but the application needs to be run on a Mac.
Any suggestions would be most welcome.

Author:  pixe656 [ Wed Mar 28, 2012 9:22 am ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

Google this and you will get many answers: site:http://forums.realsoftware.com/ mac office

Author:  npalardy [ Wed Mar 28, 2012 10:37 am ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

pvman65 wrote:
What is the current status of using Real Basic for automating MS Office applications on a Mac?
I need to extract data from an Excel spreadsheet and insert these in Word templates in order to build Building Blocks for Word.
Both Excel and Word will be running on a Mac.
My development platform is on Windows 7 but the application needs to be run on a Mac.
Any suggestions would be most welcome.


Applescript is the way to go
They are very scriptable
But the integration with RB like it works on Windows is not available

Author:  pvman65 [ Thu Mar 29, 2012 5:53 pm ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

Many thanks for the replies npalardy and pixe656.
I will follow up on the suggestions. Just a pity that the normal cross platform magic doesn't seem to work here.

Author:  npalardy [ Thu Mar 29, 2012 6:51 pm ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

It'd be nice but MS has not supplied an updated SDK for Office on the Mac that would allows us to do anything

Author:  pvman65 [ Fri Mar 30, 2012 5:57 am ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

Thanks for the clarification.
I know from an earlier posting that that was the situation about 16 months ago but I hoped that there might have been a change.
Well, I'll get my head down and find a solution. Once again thanks for your thoughts.

Author:  markwalsh [ Fri Mar 30, 2012 7:49 am ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

Office documents from 2007+ are actually collections of XML files. If you know XML, you may be able to access the contents of the documents.

I don't know XML, but if you change the '.xls' extension of your Excel file to '.zip', you can unzip the file to access the XML files. You will find the worksheets in the 'xl' directory. I would also assume you could change the contents of the document by editing the XML file(s), but I don't know the specification, so making a change to one XML file may require you to make changes to one or more of the other enclosed XML files. The same applies to your Word document.

If you can edit the contents, then re-zip the file and set the original Office extension, and this might work to allow you to edit the documents directly.

Author:  pvman65 [ Fri Mar 30, 2012 11:47 am ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

Thanks for the suggestion. Given my total lack of experience with XML I'm inclined to leave this possibility for investigation at a later date. There are a couple of "low tech" options I'm going to explore first, especially since I can only have patchy access to a Mac for testing.

Author:  markwalsh [ Fri Mar 30, 2012 12:29 pm ]
Post subject:  Re: Using Real Basic to automate Office applications on a Ma

pvman65 wrote:
Thanks for the suggestion. Given my total lack of experience with XML I'm inclined to leave this possibility for investigation at a later date. There are a couple of "low tech" options I'm going to explore first, especially since I can only have patchy access to a Mac for testing.

Yeah, I don't know if I would want to touch that myself either, even if I did know XML. But it may be a viable option to someone with the experience and time to look into it, at least theoretically. And, it may be of use to someone who may need to pull other items from the document; for example, I believe you would have easy access to any images (as folderItems) in a word document by using this method.

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/