ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
RE: WIN32::OLE help
by Neson Maxmelbin other posts by this author
Aug 18 2008 1:40AM messages near this date
view in the new Beta List Site
SOLVED: WIN32::OLE help | Re: WIN32::OLE help
Hello Steve,

It does work and my machine shows the same values for minimise and maximise ..
But what does these value depend on ?

I checked in another machine and the maximise value is -4137 ...

Where do i find the constants declared for these ?

Thanks and Regards
Maxmelbin Neson



________________________________
From: perl-win32-users-bounces@[...].com [mailto:perl-win32-users-bounces@[...].com] On Beha
lf Of Steve Howard (PFE)
Sent: Friday, 15. August 2008 1:34 AM
To: Neson Maxmelbin (RBEI/EMT4); perl-win32-users@[...].com
Subject: RE: WIN32::OLE help

I'll type this directly in so I might make a typo. You should be able to set the state in th
e application object:

$Excel-> {WindowState} = -4140;

To set back to normal mode:

$Excel-> {WindowState} = -4143;

The way to find this is to record a macro in Excel, and do what you want to see. Then view t
he macros and see what was done. In this case, the macro uses constants xlMinimized, and xlN
ormal. You can use the object browser to see the values of those constants. They're probably
 in the constants you have imported as well, so it would probably be better to use them ther
e rather than the literal values.

See if this helps.

Steve

From: perl-win32-users-bounces@[...].com [mailto:perl-win32-users-bounces@[...].com] On Beha
lf Of Neson Maxmelbin (RBEI/EMT4)
Sent: Thursday, August 14, 2008 4:30 AM
To: perl-win32-users@[...].com
Subject: WIN32::OLE help


Hello ,

I am using WIn32::OLE to Read contents of an Excel sheet.
There is no issues on reading, but the problem is that Excel file opens on the screen, durin
g the time the script processes the file.

I don't need this.
One solution was to make it not visible ($Excel-> {'Visible'} = 0;).
But this had some other problems. In some cases, when this Excel sheet was open for viewing,
 its contents were hidden ! , when we move the mouse over the cells, then we see it .. might
 be a Excel Bug. Due this we cannot make the Excel sheet invisible during the runnign of the
 script.

What I need now is to minimise the sheet once it is opened. How do we do it ?

My code extract -

use Win32::OLE::Const 'Microsoft Excel';

$Excel = Win32::OLE-> GetActiveObject('Excel.Application')|| Win32::OLE->new('Excel.Applicati
on', 'Quit');

$Excel-> {'Visible'} = 1;

$xlFile = 'C:\HWEConfig.xls';

eval { $Book = $Excel-> Workbooks->Open("$xlFile"); };

... then the reading ....





Thanks and Regards
Maxmelbin Neson
Thread:
Neson Maxmelbin
Steve Howard
Brian Raven
Neson Maxmelbin
Neson Maxmelbin
Ekkehard Goerlach
Anthony Okusanya
Jenda Krynicky
Anthony Okusanya

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved