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

Re: install cpan Win32::OLE on cygwin - t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":

by Corion (Patriarch)
on Aug 01, 2013 at 13:26 UTC ( [id://1047453]=note: print w/replies, xml ) Need Help??


in reply to install cpan Win32::OLE on cygwin - t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":

The error message from Excel is:

Microsoft Excel cannot open or save any more documents because there i +s not enough available memory or disk space. • To make more memory available, close workbooks or programs you no lo +nger need. • To free disk space, delete files you no longer need from the disk yo +u are saving to.

What steps have you taken to verify that this error message reflects reality? What steps have you taken to remedy this error condition?

Replies are listed 'Best First'.
Re^2: install cpan Win32::OLE on cygwin - t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":
by Anonymous Monk on Aug 01, 2013 at 14:16 UTC
    To answer your questions:

    What steps have you taken to verify that this error message reflects reality?

    I think there is enoug disk and memory. Refer my previous answer.

    I don't believe the message reflects reality. But I don't know why I would get a spurious message if the script deoes the right thing.

    Re: What steps have you taken to remedy this error condition?

    I googled the message and did not find a similar experience. The error is reported in different circumstances. Seems to indicate that others have been able to install Win32::OLE under cygwin.

    I used Win32::OLE under XP, Excel 200? and cygwin. Installed without issues. So maybe there is something about Win 7 or Excel 2010

    I tried the script in the debugger. I posted the Trace. I also checked variable values. They look normal, although I have no definitive idea what the values should be and the perl constructs used are beyond my expeience.

    I have no idea how to progress this further.

        I'll give that a go. But since the test verifies the creation of a workbook:
        >> 3_ole.t:130: my $Book = $Excel->Workbooks->Add;
        I thought it was an indication of a serious issue. But I agree, it pays to be optimistic!!

        The other branch in this conversation leads me to think that the message is spurious. Win 7 Excel 10 makes an issue out of documents that are attachments to emails. They need to be enabled before you can do something to them. Maybe the under Windows 7/Excel 2010 scripts need to tell the create operation that this is a trusted operation? I don't know how to do that, but I will investigate that too in 8 hours time.

Re^2: install cpan Win32::OLE on cygwin - t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":
by Anonymous Monk on Aug 01, 2013 at 13:31 UTC
    Apologies for being obtuse.

    Excel operates normally on the laptop.

    There is 241 Gbyte free space on the disk.

    The Task manager > Performance shows 1Gbyte memory (Out of 2 Gbyte) avalable whilst the script runs.

        Cleaned the TEMP directory (78Mbyte)

        Path is set correctly

        The Unblock suggestion is premature becuase the script tries to create a workbook. I don't understand enough to decide whether the script is still getting to set up the create call or is actually doing the call to create the file and cannot. I suspect the latter.

        The Unblock suggestion made me think that maybe some security setting prohibits the creation of a file on the file system from a script? What could that be?

        Thanks for the thought.

Re^2: install cpan Win32::OLE on cygwin - t/3_ole.t ....... 1/58 OLE exception from "Microsoft Excel":
by Anonymous Monk on Aug 02, 2013 at 10:15 UTC
    I have installed Win32::OLE with cpan notest install Win32::OLE.

    That worked without a hitch.

    I created a powershell script (try.ps1) that uses the add method:

    $excel = new-object -comobject Excel.Application $excel.visible = $true $workbook = $excel.workbooks.add()
    The command:
    powershell -file try.ps1
    displays an excel workbook with 1 worksheet when executed in the cygwin environment

    So, unless powershell has security magic, scripts can do this, there is enough memory and disk space.

    I created an equivalent perl script (try.pl):

    #!/usr/bin/perl -w use strict; use Win32::OLE; my $ex = Win32::OLE->new('Excel.Application', \&Quit); $ex->{visible} = 1; print "S1 .. "; sleep 10; print "Done.\n"; my $book = $ex->Workbooks->Add(); print "S2 .. "; sleep 10; print "Done.\n"; exit;
    The sleep statements makes what happens visible. Otherwise the script just finishes with the error message below.

    The command:

    perl -w try.pl
    displays an empty workbook. There is no worksheet displayed.

    The workbook closes when the script finishes and the following is displayed:

    S1 .. Done. OLE exception from "Microsoft Excel": Microsoft Excel cannot open or save any more documents because there i +s not enough available memory or disk space. ¢Æ To make more memory available, close workbooks or programs you no l +onger need. ¢Æ To free disk space, delete files you no longer need from the disk y +ou are saving to. Win32::OLE(0.1709) error 0x800a03ec in METHOD/PROPERTYGET "Add" at try.pl line 11 S2 .. Done.
    So it appears that Add has a problem in my environment.

    I don't believe the message is disk space or memory related, there is heaps of both as I posted earlier in this conversation. And I would expect the poweshell script to have the same problem. But that script runs fine.

    I inspected the cpan make compile output, which I noticed had many warnings. All the same but for the location:

    OLE.xs:5764:39: warning: deprecated conversion from string constant to + ¡®char*¡¯ [-Wwrite-strings]
    It's only a warning. Could it lead to my problem?

    Suggestions welcome.

      It's only a warning. Could it lead to my problem?

      No. help set, dumper %ENV, start there

        Any suggestion what I should be looking for? I compared the PATH in %ENV, cygwin set ans cmd set. They are the same except that the cmd set PATH variable does not contain
        /usr/local/bin
        and
        /usr/bin

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (2)
As of 2024-03-19 10:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found