General information
Category:
COM/DCOM and OLE Automation
Title:
Sharing violation error.
Hi,
I have been plagued by the following intermitent error when trying to append data from Excel work sheets into foxpro tables.
"OLE error code 0x80030020: A share violation has occurred."
It doesn't seem to occur with any pattern, just regularily! However, it seems that it doesn't occur when the program is being debugged. The line of code used is this;
APPEND FROM "&lcNewAppend" XL5 SHEET &lcSheet
lcNewAppend being the name of the excel file and lcSheet being the name of the individual sheet.
Previous to command being issued the program creates a copy of the excel file, opens it via creatobject(), removes spaces from the names of each worksheet within that workbook and saves it as XL5 file format. The object reference is then quit and released. There is no possibility of the file being in use by another source as the program uses the copy of the original file. Could it be that foxpro retains something in memory refering to individual sheets or the workbook even after the instance of excel has been released???? How come it seems to work ok when stepping through using the debugger?? Would cusing a pause in the program help???
Cheers for any assistance,
Lee.
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only