Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy a sheet in an Excel workbook
Message
De
09/06/1999 13:00:19
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Copy a sheet in an Excel workbook
Divers
Thread ID:
00227990
Message ID:
00227990
Vues:
85
I am trying to find the proper syntax for creating a copy of a sheet in an Excel workbook. The VBAXL8.HLP file gives examples as:

Worksheets("Sheet1").Copy after := Worksheets("Sheet3")

but I cannot get that to work. I have tried many variations such as:

oleapp.Worksheets("Sheet1").Copy after oleapp.Worksheets("Sheet3")
oleapp.Worksheets("Sheet1").Copy after Worksheets("Sheet3")
oleapp.Worksheets("Sheet1").Copy('after Worksheets("Sheet3")')
oleapp.Worksheets("Sheet1").Copy(after Worksheets("Sheet3"))
oleapp.Worksheets("Sheet1").Copy('after oleapp.Worksheets("Sheet3")')
oleapp.Worksheets("Sheet1").Copy 'after oleapp.Worksheets("Sheet3")'
oleapp.Worksheets("Sheet1").Copy after 'oleapp.Worksheets("Sheet3")'
oleapp.Worksheets("Sheet1").Copy 'after :=Worksheets("Sheet3")'
oleapp.Worksheets("Sheet1").Copy 'after "Sheet3"'
oleapp.Worksheets("Sheet1").Copy after "Sheet3"

The best I have found is that the copy is made but placed in a new workbook. I need to be able to create the copy in the same workbook.
Mark Johns
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform