Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 304761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:18:37+00:00 2026-05-12T07:18:37+00:00

How can a I guarantee that no pop-up dialogs will appear when I automate

  • 0

How can a I guarantee that no pop-up dialogs will appear when I automate Microsoft Excel through OLE? I’m using a Perl module (Win32::OLE). I can avoid most dialog pop-ups using the following code:

use Win32::OLE;
use Win32::OLE::Variant;
use Win32::OLE::Const;

my $excel_symbols = Win32::OLE::Const->Load('Microsoft Excel');
my $excel = Win32::OLE->new('Excel.Application', sub { $_[0]->Quit();} );
$excel->{'Visible'} = 0;
$excel->{'DisplayAlerts'} = 0;
$excel->Workbooks->Open('c:\some_excel_file.xls',
  { 'UpdateLinks' => $excel_symbols->{'xlUpdateLinksNever'},
    'ReadOnly' => 1,
    'IgnoreReadOnlyRecommended' => 1
  });

However for some files, I continue to get a dialog with the following text:

This file is not a recognizable
format.

  • If you know the file is from another program which is incompatible with
    Microsoft Excel, click Cancel, then
    open this file in its original
    application. If you want to open the
    file later in Microsoft Excel, save it
    in a format that is compatible, such
    as text format.
  • If you suspect the file is damaged, click Help for more information about
    solving the problem.
  • If you still want to see what text is contained in the file, Click OK.
    Then click Finish in the Text Import
    Wizard.

OK Cancel

Sometimes a similar dialog appears that contains ‘OK’, ‘Cancel’ and ‘Help’ buttons.

I cannot control the quality of files that are provided to the scripts.

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:18:38+00:00Added an answer on May 12, 2026 at 7:18 am

    I revisited this issue and found a solution.

    Copy the file before processing to a temporary location. Then save the file before closing it in Excel:

    File::Copy::copy('c:\some_excel_file.xls', 'c:\temp\SFO3jfd.xls');
    my $book = $excel->Workbooks->Open('c:\temp\SFO3jfd.xls',
      { 'UpdateLinks' => $excel_symbols->{'xlUpdateLinksNever'},
        'ReadOnly' => 1,
        'IgnoreReadOnlyRecommended' => 1
      });
    $book->Save();
    $book->Close();
    

    Why this works:

    Excel 2003 automatically recalculates the formulas in documents that were created in an older version of Excel. Furthermore, macros could be invoked when the document is opened. All of this means that there could be changes made on a document, even though your script doesn’t perform any such operations.

    By saving the document before closing, you avoid the dialog requesting that you save the file. Using a temporary file ensures that the original file does not get changed during the validation operation. If you aren’t concerned about this, you might consider validating in-place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I guarantee that floating point calculations in a .NET application (say in
Is there anyway I can guarantee that every document with all query terms always
trait NotNull {} I've been trying to see how this trait can guarantee that
Can't find the answer to my question in MSND: Does Timer class guarantees that
Can I authenticate with just Google account username and password instead of using OAuth?
In some database technologies, for a attribute in a record, you can guarantee uniqueness
I tried to create a container for posible metadata that can be attached to
I rewrote entire question to make it clear. I need a type that can
I have this alert view (disclaimer) that pop up when app finish launching. It
How can I configure the maximum memory that a query (select query) can use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.