in reply to Re: Win32 Active Window
in thread Win32 Active Window
If the only window you are competing with is the Word Window the following is tested and works on 5.8.0 on XP-SP2 with Office 97. You could probably just not make the word window visible also .. however if they both need to be in the taskbar.. this works fine.
use strict; use warnings; use Win32::OLE; use Win32::OLE::Const; my $xl = Win32::OLE->new('Excel.Application'); my $xlConst = Win32::OLE::Const->Load('Microsoft Excel 8.0 Object Libr +ary'); #Add a workbook so the window doesn't autoclose $xl->Workbooks->Add(); my $word = Win32::OLE->new('Word.Application'); my $wordConst = Win32::OLE::Const->Load('Microsoft Word 8.0'); #Set both visible to test $word->{Visible} = -1; $xl->{Visible} = -1; #Minimize Word $word->{WindowState} = $wordConst->{'wdWindowStateMinimize'}; #Maximize Excel $xl->{WindowState} = $xlConst->{'xlMaximized'};
|
|---|