Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Error when trying to open and paste to Excel.
Message
De
21/01/2005 09:39:30
Jim Winter
Jim Winter Consulting
Hinesburg, Vermont, États-Unis
 
 
À
20/01/2005 14:25:37
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6
Database:
Visual FoxPro
Divers
Thread ID:
00979002
Message ID:
00979248
Vues:
19
>I ran into a situation where a particular user is getting errors when trying to "Export to an excel spreadsheet.
>
>Here is the code that is running:
>
>oexcel=CREATEOBJECT("excel.application")
>IF VARTYPE(oexcel) != "O"
> =MESSAGEBOX("You must Install Excel in order to run this option","Install Excel")
>ELSE
> SELECT accounts
> _vfp.DataToClip(,,3)
> oExcel.Workbooks.Add()
> oexcel.ActiveSheet.paste
>ENDIF
>
>The first error message that appears is OLE error code 0x8002801d: Library not registered.
>
>The second error:OLE IDispatch exception 0 from Microsoft Excel: Unable to get the Paste property of the Worksheet class.
>
>Excel is installed on the machine and after the errors, excel does open but with a blank worksheet. Could the DatatoClip be causing the issue?
>
>Any help would be great.
>
>Thank you

Chistine,

Try:
oExcel.Workbooks.Add()
* Get a deeper object reference
oSheet = oExcel.ActiveSheet
oSheet.Paste()
Tested in Version 7.

Regards,
Jim
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform