excel - Problems reading a .xls file using Perl Win32::OLE under Cygwin -


I am fighting this one for two days, I am not getting the solution and I am frustrated. I get this error when using code given below signin

OLE Exceptions from "Microsoft Office Excel": Excel can not access 'Empty.xls'.
The document may be read-only or encrypted. Win32 :: OLE (0.1703) error 0x800a03ec METHOD / PROPERTYGET in "Open" in M: / in / mac_excel.apple 24

The thing is that under the DOS prompt it works perfectly Has been doing . The file is not read-only for the course. I think there is some problem with file format interpretation. Any sign? It will be highly appreciated.

  #! Use / usr / bin / perl Win32 :: OLE; Use Win32 :: OLE :: Variant; Use Win32 :: OLE :: Conte 'Microsoft Excel'; $ Excel = Win32 :: OLE- & gt; GetActiveObject ('Excel.Application') || Win32 :: OLE- & gt; New ('Excel.Application'); $ Excel-> {'Visible'} = 0; # 0 is hidden, 1 is visible $ Excel-> {DisplayAlerts} = 0; # 0 Hide Alert # Open file and worksheet My $ book = $ excel-> workbooks-> Open ('C: \ blank.x');    

MS Excel requires MS Windows Path.

The problem is

  My $ seedproject = "$ ENV {'HOME'} / Empty.xls";   

Use '\\' instead of '/': Excel only works with window paths. Check the path limitometers in $ ENV {HOME} too.

Comments