in reply to WriteExcel to OLE?

The objects, methods, and properties are thoroughly documented in the Excel VBA help file. It is not installed in a default installation of Office, so you may (or may not) already have it installed. You'll want to at least familiarize yourself with Excel's object model (Application->Workbooks->Worksheets->Range->...) Also, look at the OLE Browser included with AS Perl.

As far as Perl documentation of OLE, ActivePerl-WinFAQ12.html should be available locally - if not, it's on the Active State website. perldoc Win32::OLE provides some useful information, too.

As far as converting VB syntax in the help file to perl, the basic rules are:

The first thing I do usually is record a macro that does the basics of what I want. Then, I use Win32::OLE::Const 'Microsoft Excel'; to import all Excel constants, so I can copy examples from the from macro I've recorded (or from the helpfile) without looking up the values of the constants. Then I can translate until it all works like I expect it.

All in all, controlling Excel is quirky at best, and ugly at its worst. I have some notes I've taken, but they aren't formatted in any useful way. If you want to see them, let me know.

Hope all this helps in some small way...

Replies are listed 'Best First'.
Re: Re: WriteExcel to OLE?
by dimmesdale (Friar) on Jul 15, 2002 at 21:31 UTC
    That's what I got from some of the resources I looked at (the VBA files, that is). However, (unfortunately), I do not have those file installed on the computer (I just started using it a few weeks ago, and Excel was there).

    Is there some internet site that has these copied? also, what about the 'Object Model'? I hadn't used Excel before about two weeks ago, so I don't know much about it. Are these in the VBA files, or somewhere else?

      Ask whoever admins your computer to install it. Or check http://msdn.microsoft.com/library. I don't know if msdn includes all docs, but look at the left pane for Office Solutions Development, then check under both Excel and Office. Then check http://office.microsoft.com.

      About the object model, a quick google search shows several resources. The OM shows how each object fits into the heirarchy of all Excel objects, which objects are collections, which methods and properties are associated with which object.

      Seriously, though, open excel, tools->macro->record macro. Then view the source Excel creates. It's VB code, and it is pretty easy to understand. It'll take you a little time, but you'll find it makes learning to write the automation code easier. Create the Excel object, open/add the workbook, insert translated and/or new code here, save (and save often), quit.