pankaj_it09 has asked for the wisdom of the Perl Monks concerning the following question:

The below code displays the password protected excel files even though the display is set to 0.

use Win32::OLE; $Excel = Win32::OLE->new('Excel.Application') or die "oops\n"; $Excel->Workbooks->Open({FileName => "D:\\Perl\\bin\\search tool\\test +.xls"}) || die ("$!\n"); $Excel->{Visible} = 0; $Excel->Quit;

Replies are listed 'Best First'.
Re: Password Protected Excel Files Open while Display set to 0
by Anonymous Monk on Jan 23, 2009 at 07:07 UTC
    check for errors
      According to the above code the excel files should not get open as display is set to 0.
        But you're not checking for errors
        Win32::OLE->LastError()
        A reply falls below the community's threshold of quality. You may see it by logging in.
        What Excel version are using?
        As this code is based on the deprecated OLE interface, there is a risk that MS has not implemented it properly in newer version.