Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Problems with Win32::OLE and different Office versions

by JamesNC (Chaplain)
on Jul 07, 2004 at 11:16 UTC ( [id://372340]=note: print w/replies, xml ) Need Help??


in reply to Problems with Win32::OLE and different Office versions

The problem is with the path used $restrictfile. I get your error if my path is wrong, make sure you use the full absolute path.(eg 'c:\\myfiles\\test.xls') Excel defaults to My Documents when it calls Open() vs the local directory your are executing your script from.

JamesNC
  • Comment on Re: Problems with Win32::OLE and different Office versions

Replies are listed 'Best First'.
Re^2: Problems with Win32::OLE and different Office versions
by Nkuvu (Priest) on Jul 07, 2004 at 22:22 UTC

    I've also found that even though Perl can handle forward slashes as path delimiters, Excel can't. For example:

    # ... other code before this ... if (-e "c:/myfiles/test.xls") { # We get here just fine, but... $Book = $Excel->Workbooks->Open("c:/myfiles/test.xls") or die "Hork!\n"; # Dies }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-20 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found