Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
COPY MySheet ( Help!!)
Message
 
À
08/11/2000 13:51:54
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00439327
Message ID:
00439338
Vues:
21
>I'm copying a "template" sheet within a workbook in order to make one sheet for each employee. I want to add a sheet called "Cindy" to the current workbook - either at the end (Sheets(Count)) or after some particular sheet.
>
>I have
lcSheetType = "Monthly"
>lcEmployee = "Cindy"
>oExcel.Sheets(lcSheetType).Copy()
which creates a new workbook and puts a sheet called "Montlhy" in it - but I want it to be in the current workbook! The docs say the syntax I need is
Worksheets("Sheet1").Copy after := Worksheets("Sheet3")
but I can't translate this into anything I can use.
>
>Help is appreciated!
Hi Cindy,

it is not a big deal. :)

If you try to substitute the parameter with worksheet name or number it does not work because it has to be an object reference:

A sample:

ox = createobject("excel.application")
ox.visible = .t.
oWorkbook =ox.ActiveWorkbook
obefore = oWorkBook.Sheets(2)
oWorkbook.Sheets(3).Copy(oBefore)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform