Skip Menu |
 

This queue is for tickets about the Win32-OLE CPAN distribution.

Report information
The Basics
Id: 20733
Status: open
Priority: 0/
Queue: Win32-OLE

People
Owner: Nobody in particular
Requestors: james.baker [...] ericsson.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.17
Fixed in: (no value)



Subject: Win32::OLE::Const causes a problem with getOpenFile/getSaveFile
Download (untitled) / with headers
text/plain 1.5k
Hi, I have several applications which use Perl/Tk for the gui and Win32::OLE to read from and write to Excel. I have discovered that: use Win32::OLE::Const 'Microsoft Excel'; introduces a problem with getOpenFile and getSaveFile, namely clicking the 'My Documents' button in the file select window locks up the application. Trying to close the window gives a 'This program is not responding' window, and the only way out is to click 'End Now'. It doesn't matter how long you wait, the program bever recovers. The same thing happens if you select 'My Documents' from the pull down list or click 'Desktop' then 'My Documents' from there. Basically you cannot go directly to 'My Documents', but you can navigate there the slow way. I have done a little experimenting and tried using the actual numbers in my code instead of calling Win32::OLE::Const. This is fine until after the first time the program actually opens Excel, then after that we are back to the fault situation. This fault existed in previous versions of Perl 5.6 also. I am using Windows 2000 operating system. My perl distribution is: C:\Documents and Settings\epajsb>perl -v This is perl, v5.8.8 built for MSWin32-x86-multi-thread (with 25 registered patches, see perl -V for more detail) Copyright 1987-2006, Larry Wall Binary build 817 [257965] provided by ActiveState http://www.ActiveState.com Built Mar 20 2006 17:54:25 According to my Perl documentation the version of Win32::OLE is Version 0.1704 28 November 2005 Thanks in advance for your time.
Subject: RE: [rt.cpan.org #20733] Win32::OLE::Const causes a problem with getOpenFile/getSaveFile
Date: Thu, 27 Jul 2006 23:59:54 -0700
To: <bug-Win32-OLE [...] rt.cpan.org>
From: "Jan Dubois" <jand [...] activestate.com>
Download (untitled) / with headers
text/plain 717b
Show quoted text
> I have discovered that: > > use Win32::OLE::Const 'Microsoft Excel'; > > introduces a problem with getOpenFile and getSaveFile, namely clicking > the 'My Documents' button in the file select window locks up the > application. Trying to close the window gives a 'This program is not > responding' window, and the only way out is to click 'End Now'. It > doesn't matter how long you wait, the program bever recovers.
Could you try adding the following line to the top of your script (after the "use Win32::OLE" line): Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); I suspect that the common dialogs used by Tk don't work when COM is initialized in multi-threaded apartment mode. Cheers, -Jan
Subject: RE: [rt.cpan.org #20733] Win32::OLE::Const causes a problem with getOpenFile/getSaveFile
Date: Fri, 28 Jul 2006 21:55:10 +1000
To: <bug-Win32-OLE [...] rt.cpan.org>
From: "James Baker \(BR/EPA\)" <james.baker [...] ericsson.com>
Download (untitled) / with headers
text/plain 2.1k
Hi Jan, Thank you for your suggestion. My script now reads like so (as suggested): use Win32::OLE; Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; and I'm sorry to report that there is no change, the fault still occurs. Please keep the suggestions coming, I have been struggling with this for a very long time... Regards... James Baker Core Networks, GSDC Australia Ericsson Australia Pty. Ltd. Tel : +613 93013056 Mobile : +65 9839 9788 james.baker@ericsson.com This communication is confidential and intended solely for the addressee(s). Any unauthorized review, use, disclosure or distribution is prohibited. If you believe this message has been sent to you in error, please notify the sender by replying to this transmission and delete the message without disclosing it. Thank you. E-mail including attachments is susceptible to data corruption, interruption, unauthorized amendment, tampering and viruses, and we only send and receive e-mails on the basis that we are not liable for any such corruption, interception, amendment, tampering or viruses or any consequences thereof. Show quoted text
-----Original Message----- From: jand@ActiveState.com via RT [mailto:bug-Win32-OLE@rt.cpan.org] Sent: Friday, 28 July 2006 3:00 PM To: James Baker (BR/EPA) Subject: RE: [rt.cpan.org #20733] Win32::OLE::Const causes a problem with getOpenFile/getSaveFile <URL: http://rt.cpan.org/Ticket/Display.html?id=20733 >
> I have discovered that: > > use Win32::OLE::Const 'Microsoft Excel'; > > introduces a problem with getOpenFile and getSaveFile, namely clicking
> the 'My Documents' button in the file select window locks up the > application. Trying to close the window gives a 'This program is not > responding' window, and the only way out is to click 'End Now'. It > doesn't matter how long you wait, the program bever recovers.
Could you try adding the following line to the top of your script (after the "use Win32::OLE" line): Win32::OLE->Initialize(Win32::OLE::COINIT_OLEINITIALIZE); I suspect that the common dialogs used by Tk don't work when COM is initialized in multi-threaded apartment mode. Cheers, -Jan


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.