Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

ole for excel 2013 is opening windows

by rlafetra (Initiate)
on Nov 15, 2014 at 00:35 UTC ( [id://1107276]=perlquestion: print w/replies, xml ) Need Help??

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

I have a number of scripts that use Perl's Win32::OLE to manipulate Excel. I recently upgraded my machine, and am now running Excel 2013 (I was running Excel 2010, both the 32 bit versions). Whenever the script opens up Excel (or maybe it is the workbook), a window appears -- this didn't used to happen. The problem is I'm doing a fair amount of drawing, and the drawing is remarkably slower when the window is open, so I want it closed. Any clue on what I need to do to restore the Excel 2010 behavior of not opening a window?

Replies are listed 'Best First'.
Re: ole for excel 2013 is opening windows
by Anonymous Monk on Nov 15, 2014 at 01:08 UTC

    Any clue on what I need to do to restore the Excel 2010 behavior of not opening a window?

    I vaguely recall reading on MSDN this is some kind of security feature ... msdn hide excel window

      I didn't get very far with that. However, I did poke more, and discovered a partial solution. With the code below, Perl opens a window briefly (longer than I would like), then minimizes it, which gets me the faster execution time I'm looking for, but leaves it a pain for the user as a maximized window is opened for several seconds... The code is (fragments copied here)

      use Win32::OLE;
      use Win32::OLE::Const 'Microsoft Excel';
      my $application = Win32::OLE->new("Excel.Application");
      my $workbook = $application->Workbooks->Open($pinout);
      $application->{WindowState} = xlMinimized;
      

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1107276]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found