Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to prevent OLE-error

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Scenario:
Export file to excel.
Open Excel sheet.
Again export to Excel (same filename)
Than OLE error 0x80030021 'Schending van vergrendelingsrechten' occurs.
Can I catch that OLE-error?
-Bart
 
Bart,

I think my Dutch goes far enough to understand that you're running into an access violation. Have you tried to open that very file in Excel before you attempted to open / create it again? If you export (as in COPY TO ... TYPE XLS) VFP will create a new file, i.e. open that file exclusively, which will conflict with Excel's import mechanism. Where about in your code are you exporting? If it is within an object of any sort (for instance a form) you can use the error event to catch that error, otherwise use ON ERROR DO myHandler WITH Error(). It's then up to you what to do with the error and no message will occur.

Volker/
 
Hi Volker,
Thanks for yr explanation.
I am going to try to follow yr suggestion.
Will come back with the result.
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top