merrymonk has asked for the wisdom of the Perl Monks concerning the following question:

I am having trouble closing one particular spreadsheet.
I am using
$close_res = $workbook->Close(); print "[open_spreadsheet] 1st close result <$close_res>\n"; $close_res = $workbook->Close(); print "[open_spreadsheet] 2nd close result <$close_res>\n";


and the messages I get from this are
open_spreadsheet 1st close result <1>
open_spreadsheet 2nd close result <>
The second close was added because of the problem.
However, when I try and move the spreadsheet I get the following

result of moving file is <0>
could not find move file error - number <32> message <The process cannot access
the file because it is being used by another process.

Also I cannot open and file the spreadsheet using Excel until I close the application
that has used this spreadsheet.
I have not had this trouble with other spreadsheets
The original spreadsheet was written by someone else.
Therefore in an attempt to overcome this I copied the cells from the original
to a new spreadsheet.
However, I still got the same problem.
Has any one any idea how to solve this one?

Replies are listed 'Best First'.
Re: Closing Spreasheet Problem
by monkey_boy (Priest) on Oct 31, 2005 at 15:39 UTC
    It would help if you told us which SpreadSheet module you were using!



    This is not a Signature...
      Sorry for the omission
      . I start with lines such as
      $excel = Win32::OLE->new('Excel.Application', 'Quit')
      that I believe comes from 'using' use Win32;
      I hope that is sufficient but if not I can easily supply more details