I have an application that saves a Cells workbook to a PDF document. This document contains a jpeg image.
If I save the document twice, I receive an exception while trying to save the second one:
System.IO.IOException: The process cannot access the file 'c:\Temp\tmpFile.tmp_img0.jpg' because it is being used by another process.
The line that is throwing the exception is:
When I stop the application and restart it, there is no problem saving once (but not twice).
I know for sure that this image is my header.
There is no Dispose method on the Workbook object. Setting my mWorkbook object or not does not fix the exception. Is there any resource I should free?