A
adammfellows
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\CentralProcurement\ProcurementFormData.xls")
..
..
..
End sub
..
..
Function Item_Close()
xls.close
"\\uknpt003\Departments\CentralProcurement\ProcurementFormData.xls"
set xls = nothing
set cts = nothing
set ins = nothing
End Function
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\CentralProcurement\ProcurementFormData.xls")
..
..
..
End sub
..
..
Function Item_Close()
xls.close
"\\uknpt003\Departments\CentralProcurement\ProcurementFormData.xls"
set xls = nothing
set cts = nothing
set ins = nothing
End Function