Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy a sheet in an Excel workbook
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00227990
Message ID:
00229924
Vues:
39
Bruce,

I had tried that before with a single space and with an empty string and the result is "OLE IDispatch exception code 1004 from Microsoft Excel: Unable to get the Copy property of the worksheet class." What I did not try until just now is:

oleApp.Worksheets('sheet1').copy(.null.,oleApp.Worksheets('sheet2'))

THIS WORKS!! :)

Thanks to you and Perry for giving me different approaches to try.

Mark

>>Perry,
>>
>>I am not sure what I could be doing wrong. I am doing the following:
>>
>>oleApp = CREATEOBJECT("Excel.Application")
>>oleApp.Visible=.t.
>>oleApp.Workbooks.open(curdir()+"crosstab.xls")
>>oleApp.Worksheets('sheet1').copy(,oleApp.Worksheets('sheet2'))
>>
>>The result of the last command is a syntax error.
>>
>>Are you adding any spaces or anything else that I may be missing?
>
>Just a WAG, but once or twice I've gotten similar parameter problems to work by passing it something - if it's char, you can try a space, something like that...
>
>oleApp.Worksheets('sheet1').copy(' ',oleApp.Worksheets('sheet2'))
Mark Johns
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform