in reply to Re^2: Is an Excel spreadsheet open?
in thread Is an Excel spreadsheet open?

Again, why don't you ask Excel about its open files?

# From memory, as I don't have Excel at hand currently use Win32::OLE 'in'; my $excel = Win32::OLE->CreateObject('Excel.Application'); for my $wb (in($excel->{Workbooks})) { print $wb->{Filename},"\n"; };

Replies are listed 'Best First'.
Re^4: Is an Excel spreadsheet open?
by merrymonk (Hermit) on Feb 10, 2010 at 17:39 UTC
    Thanks again.
    I tried what you have most recently suggested as in the Perl below.
    When I run it with two spreasheets open, sadly I do not get anything printed out.
    It seems that the in does not find anything.
    Where will I find more about 'in'.
    use OLE; use Win32::OLE::Const "Microsoft Excel"; use strict "vars"; use Win32::OLE 'in'; my $excel = Win32::OLE->CreateObject('Excel.Application'); for my $wb (in($excel->{Workbooks})) { print "in loop\n"; print $wb->{Filename},"\n"; }

      Have you considered reading the Win32::OLE documentation for in?

      For the rest, you will need to read, again, the Win32::OLE documentation, to find out how to get at the currently running instance(s) of Excel.

        I will try again.
        I suspect much of what I want is there.
        However, I do find that its terminology and language does obscure what it is saying.