is there a $Book->Save(-force=true)  kind of option?
maybe it's just confused as to whether it can overwrite
teh existing file.
 
Gonna be a long night.....
 

________________________________

From: Greg London
Sent: Mon 10/2/2006 5:04 PM
To: Greg London; Boston Perl Mongers
Subject: RE: [Boston.pm] OLE, excel, and perl


In case that gibberish isn't readble,
I'm running perl from Windows,
ActiveState perl version 5.8.8.
and I'm opening/modifying/saving
a spreadsheet on a windows
letter drive that is mapped to a 
unix drive.

________________________________

From: [EMAIL PROTECTED] on behalf of Greg London
Sent: Mon 10/2/2006 4:58 PM
To: Boston Perl Mongers
Subject: [Boston.pm] OLE, excel, and perl



I'm stumped. I have a script that opens a spreadsheet,
modifies some values, and saves the new version.
The code looks like this:

(PASTE)

 # open Excel file
 my $Book = $Excel->Workbooks->Open($dest_xls);
 my $sheet = $Book->Worksheets(1);

 #######################################################
 # fill spreadsheet with parameters from incells0.txt file.
 #######################################################
# my ($param, $value);
 while( my($param, $value)= each(%params) ) {
  put_param_in_spreadsheet($sheet, $param, $value);
 }

 my $ok_value = get_ok_value($sheet);
 #######################################################
 # close spread sheet after writing
 #######################################################
 $Book->Save;
 $Book->Close;

(ENDPASTE)

That's the entire code from open to modify to close.

When I run it, it works fine for me.

Someone else is using it, and having some problems.
It turns out that when the XLS spreadsheet is on
a unix drive mapped to windows, you get a popup
message every time it tries to save or close or something.
The popup says:

"A file named VOPU.xls already exists in this location. Do you want to replace 
it?"
Yes/No/Cancel.

Why does it work fine on a windows drive but
popup when running on a unix drive?

Is there a "nice" way to make this work on
both types of drives?

I've been chasing this thing around all day,
to finally pin it down to this.
I'm tired. I'm cold.
And I just want it to work right now
so I can go home.

Greg


_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm


 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to