Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Worksheet in Excel
Message
 
À
06/07/2005 11:56:27
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 6 SP3
Database:
Visual FoxPro
Divers
Thread ID:
01029539
Message ID:
01029557
Vues:
15
I would recommend you to review the VBA syntax for the sheet copy command (in
Excel, ALT+F11, F1 ...). The syntax may be slightly different depending on the Excel Version. Most likely, it is:

oleApp.Sheets("master").Copy(, oleApp.Sheets(2))

>Hello:
>
>I have recorded a macro in Excel to copy a worksheet and came up with the following code:
>
>Sheets("master").Select
>Sheets("master").Copy After:=Sheets(2)
>Sheets("master (2)").Select
>Sheets("master (2)").Name="38730"
>
>I added this to something I had that worked...
>oleApp=createobject("Excel.Application")
>oleApp.Workbooks.open("filename.xls")
>
>...then added the code above as...
>oleApp.Sheets("master").Select &&works fine
>oleApp.Sheets("master").Copy After:=Sheets(2) &&BOMBED
>oleApp.Sheets("master (2)").Select &&Didn't get this far
>oleApp.Sheets("master (2)").Name="38730" &&Didn't get this far
>
>Any suggestions are greatly appreciated.
>
>Thanks,
>Martha
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform