in reply to Class names in OLE

Foggy Bottoms,

First off, that is a unique and though provoking name.

IMPO, it may be more work than it is worth to go looking in the registry. I agree that typeing 'Excel.Application' is a pain in the back side so here are a couple of UNTESTED alternatives...

First Method

# use Constants use constant EXCEL => 'Excel.Application'; use constant WORD => 'Word.Application'; my $excel = Win32::OLE->GetActiveObject(&WORD)

Second Method

#Use another package package MSApps; { our $MSApps::EXCEL = 'Excel.Application'; our $MSApps::WORD = 'Word.Application'; } ## Then use MSApps; my $excel = Win32::OLE->GetActiveObject($MSApps::EXCEL)

Third Method

#Do the most simple thing: create variables. my $EXCEL = 'Excel.Application'; my $WORD = 'Word.Application'; my $excel = Win32::OLE->GetActiveObject($WORD)

UpdatE: Eccentric reformating


Kristofer Hoch

Si vos can lego is, vos es super erudio

Replies are listed 'Best First'.
Re: Re: Class names in OLE
by Foggy Bottoms (Monk) on Jun 17, 2003 at 13:29 UTC
    Si vos can lego is, vos es super erudio Interesting little phrase actually... But I believe it's not correct latin, or is it ?
    If you can read this, you are really smart. Am I right ? Then it should be si istud legitis, doctissimi estis. (I studied latin a while back and still get a kick out of it - it's really cool).
    ... Anyways... as for my nickname, it comes from a metro station in DC where I used to live.

    And now back to perl, I did use constants but I was worrying about the fact that the names would change quickly. But apparently, it'd be too much trouble to go and read the registry.
    Thanks for your help, nice meeting you.
Re: Re: Class names in OLE
by krisahoch (Deacon) on Jun 17, 2003 at 17:54 UTC
    Si vos can lego is, vos es super erudio
    If you can read this, you are over educated;)

    Kristofer Hoch

    Si vos can lego is, vos es super erudio