in reply to Win32::OLE properties

have you tried $ftp->Option->{AutoCloseMethod} or maybe  $ftp->Option(AutoCloseMethod)->{Value}?!? If I were writing it that's how I'd have made it work...

Check the Excel OLE docs and look at the item property of the Worksheets collection. It is a property.. but for example .. say you want to get the code name from the first sheet in your worksheets collection... you could write it as $worksheets->Item(x)->{CodeName} using item without { } Normally you would code it as $worksheets(x)->{CodeName} however, but that's OT.

<edit> also throw use strict; in at the top of your script, it will help you become more efficient in your development (at least I think so)<edit>

anyhow hope that's what fixes it for you...

Grygonos

Replies are listed 'Best First'.
Re: Re: Win32::OLE properties
by EyeOpener (Scribe) on Mar 31, 2004 at 20:22 UTC
    Thanks, your Excel example helped to get me the answer! The proper syntax is $ftp->Option(AutoCloseMethod), as in:

    use Win32::OLE qw(in with); use Win32::OLE::Const 'CuteFTPPro'; my $ftp = Win32::OLE->new('CuteFTPPro.TEConnection', 'Close'); print "autoclosemethod is currently ", $ftp->Option(AutoCloseMethod), +"!\n"; $ftp->SetProperty('Option', "AutoCloseMethod", 1); print "autoclosemethod is now ", $ftp->Option(AutoCloseMethod), "!\n";

    That got me the output I needed:

    D:\>perl -w test.pl autoclosemethod is currently 0! autoclosemethod is now 1!

    Thanks for the quick help!