Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Reading Excel

by Ratazong (Monsignor)
on Jan 27, 2017 at 07:06 UTC ( #1180433=note: print w/replies, xml ) Need Help??


in reply to Reading Excel

My guess is also that opening the file fails.

  • Is the .xlsm-file you want to open really there? Have you tried opening it from the same directory your perl-script is in (so without a path)? In my experience Excel is sometimes picky related to path and path delimiters (slash vs. backslash).
  • In my scripts I always use $Excel->Workbooks->OpenXML instead of $Excel->Workbooks->Open. Maybe this works for you?
HTH, Rata

Replies are listed 'Best First'.
Re^2: Reading Excel
by ravi179 (Novice) on Jan 27, 2017 at 08:22 UTC

    I want to open .XLSM only.i tried using OpenXML.But it didn't help.

      How did using ->OpenXML() fail for you? What was the error message? What was the script you used?

        I already posted the script i used.i changed only open to OpenXML.The error was ...Win32::OLE(0.1709) error 0x800a03ec in METHOD/PROPERTYGET "OpenXML" atC:\Read_XLSX.pl line 9

Re^2: Reading Excel
by ravi179 (Novice) on Jan 27, 2017 at 09:13 UTC

    Can someone help me to resolve this

      Can you open the file in Excel ?. Run this to show the versions you have

      #!perl use strict; use warnings; use Win32::OLE qw(in with); # get already active Excel application or open new my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); print "Perl $] Win32::OLE Version ${Win32::OLE::VERSION}\n"; print "Running Excel $Excel->{'Version'} on $Excel->{'OperatingSystem +'}\n";
      poj

        perl 5.008009 Win32::OLE version 0.1709....Running Excel 15.0 on. I am unable to deal with Excel also..Same error is coming in both the cases.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-05-27 04:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (152 votes). Check out past polls.

    Notices?