in reply to Error 317 saving spreadsheet

Win32::GetLastError will only return a meaningfull value if called immediately after the system call. It most likely doesn't return Excel-specific information, so likely you're out of luck with your strategy of trying to find out something more specific about the error condition.

There seems to be no way to convince Excel to save the file unconditionally with the ->SaveAs method, overwriting what is potentially there, so I think you'll have to use

$excel->{DisplayAlerts} = 0; $excel->Workbooks(1)->SaveAs( $sp_full );

The documentation doesn't say much on using the return value of ->SaveAs, so you might have to guess whether it worked or not.

Replies are listed 'Best First'.
Re^2: Error 317 saving spreadsheet
by ikegami (Patriarch) on Mar 08, 2007 at 16:10 UTC

    There seems to be no way to convince Excel to save the file unconditionally with the ->SaveAs method, overwriting what is potentially there

    You could copy the spreadsheet to the new name before opening and modifying it.