Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sharing violation error.
Message
From
01/06/2001 12:43:26
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/06/2001 12:32:38
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00513902
Message ID:
00513912
Views:
16
>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.

Lee,
I had problems depending how excel instance was released in the past :
oExcel.quit
Alt+F4
Ctrl+F4

Anyway here I would ask why open excel to rename a sheet. You could directly get from sheet if you didn't use macro subst.

APPEND FROM (lcLFNExcelFile) XL5 SHEET (lcSheet)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform