A lot - Gurusamy Sarathy and then Jan Dubois redesigned the code and added a
bundle of enhancements. Old scripts should run with little or no modifications.
When writing new scripts there is no excuse for not using the new Win32::OLE
module options.

To retrieve the formatted value of a cell you should use the {'Text'}
property instead of the {'Value'} property. This returns exactly
what is being displayed on the screen though! If the column is not wide enough,
you get a value of '######':

The best way to learn about methods/properties would be through an OLE type
browser if the documentation is unavailable.

If you have Microsoft Excel or Microsoft Word available, go into the Visual
Basic Editor (Alt+F11). Now you can open the object browser window (F2) and see
what you find.

There is also an OleView program (various names and versions) included in
Microsoft Visual C++ / Microsoft Visual Studio if you don't have Office. Or you
can download it from the Microsoft COM website (http://www.microsoft.com/com/).

But it is still possible that Notes doesn't reveal anything; objects are not
required to provide type info support. For example Lotus Notes doesn't reveal
nothing about its internal constants, methods and properties; you have to look
them up in the documentation.

For some reason you get an 'OleInitialize' error if you open an OLE
application first and then open an ODBC connection to the Access ODBC driver. If
you do it the other way around, there is no problem with this.

It looks like the Access ODBC driver calls OleInitialize(). This fails when
Win32::OLE already initialized the COM subsystem as "apartment
threaded".

In order to remove the error either start the ODBC driver before the OLE
application or, better yet, initialize the OLE system with Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE);

Execute your scripts with perl -w and use strict -
this catches most of your errors. Apart from this, read the documentation for
Win32::OLE (a good start) and possibly the documentation for the object you are
trying to use.

In the case of Microsoft Office 97, make sure that you have at least updated
to Service Release 1 - much of the OLE in Microsoft Office 97 is broken without
this update.

This FAQ was compiled by Henning Michael M�ller-Nielsen of RTO based on
examples by many people, especially Jan Dubois. It is maintained by Henning
Michael M�ller-Nielsen, Philip Martin, Kevin Meltzer and Eric Smith at perlwin32faq@rto.dk.

This FAQ is in the public domain. If you use it, however, please ensure that
you give credit to the original authors.