Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: OLE Save and SaveAs

by guha (Priest)
on Sep 08, 2003 at 12:23 UTC ( [id://289748]=note: print w/replies, xml ) Need Help??


in reply to OLE Save and SaveAs

But, if the file exists then I get prompted to over right the file. That’s what I don't want to happen, I don't want to get prompted to save the file, I want the script to go ahead and save the file in any case.

You *could* just simply unlink the file on disk before saving.

unlink $ARGV[0] or die "yada yada $!"; xls -> ActiveWorkbook -> SaveAs( $ARGV[0] );

HTH

Replies are listed 'Best First'.
Re: Re: OLE Save and SaveAs
by BrowserUk (Patriarch) on Sep 08, 2003 at 12:33 UTC

    Nice lateral thinking, but it is unikely to work in this case. Win32 filesystems will protect files opened by one application from deletion or even being opened unless the first application explicitly permits the second access.


    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
    If I understand your problem, I can solve it! Of course, the same can be said for you.

      OK, rereading the OP, it is not clear whether he's loaded $ARGV[0] from disk, changed and saved to disk again. Or whether he's created the worksheet from scratch and then saved it.

      In the latter case the $ARGV[0].xls, could be the result of an previous run, and would not be held by the OS|Excel.

      The sentence blockquoted in my previous note seem to indicate the latter.

        Yep, its the latter, and its normally a server name (\\netbios name). Thanks for the help.

Log In?
Username:
Password:

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

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

    No recent polls found