I'm using Win32::IE::Mechanize to download a bunch of Excel files. Because of proxy/firewall issues, I'm stuck with this method.
The problem I'm having is that I can't seem to turn off ALL the warning dialog boxes that pop up when I try to save the displayed Excel file.
So far my code looks more or less like this:
my $spider = Win32::IE::Mechanise->new(); my $agent = $spider->{'Agent'}; my $Excel = Win32::OLE->GetActiveObject ('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{'DisplayAlerts'} = 0; LINE: while (<LINKS>) { ## Read $link and $title from filehandle ## this part works so I've left it out print "Getting link '$link'... "; $spider->get($link); print "ok\n"; print "Saving file as '$title'... "; my $doc = $agent->{'Document'}; $doc->SaveAs($title); print "ok"; }
The document saves fine, and setting DisplayAlerts to false turns off the dialog boxes that pop up then.
But when the script tries to navigate to the next file, or to any other page, another dialog box pops up that says "This document has been modified. Do you want to save your changes?".
This dialog box doesn't seem to be suppressed by either the Excel.DisplayAlerts property, or by the Silent property of the InternetExplorer object.
How do I get this box to go away?
Thanks!
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |