View Single Post
  #1  
Old November 9th 06, 03:34 PM posted to microsoft.public.outlook.program_forms
[email protected]
external usenet poster
 
Posts: 14
Default Problem when reading closing Outlook form that uses Excel sheet

Hi

I have written a custom Outlook form that opens an Excel file and reads
in data to be used in various combo box lists.

The item_close() function closes down the Excel workbook again.
Unfortunately if the user has another Excel workbook open at the time
and is in the middle of inputting to a cell, an error is generated. If
the user is not in the middle of input it works fine, even if the other
workbook has outstanding changes to be saved. Only the Excel sheet
containing the combo box data is closed, as is correct.

Does anyone know a way around this?

Thanks

For reference, the code is as follows:

Function Item_Open()

set ins = item.getinspector

set cts = ins.modifiedformpages("Message").controls
set xls =
GetObject("\\uknpt003\Departments\CentralProcureme nt\ProcurementFormData.xls")
..
..
..
End sub
..
..
Function Item_Close()
xls.close
"\\uknpt003\Departments\CentralProcurement\Procure mentFormData.xls"
set xls = nothing
set cts = nothing
set ins = nothing
End Function

Ads