Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sharing violation error.
Message
De
01/06/2001 12:43:26
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/06/2001 12:32:38
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00513902
Message ID:
00513912
Vues:
17
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform