Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel Add new sheet after the current with same formatti
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00793501
Message ID:
00793649
Vues:
81
Here it is:

with ObjExcel
...
lo=.ActiveWorkbook.Sheets("Sheet1")
lo.Copy(,.ActiveWorkbook.Sheets(1))
wait wind time 1.0 "" &&wait until completed
WITH .ActiveSheet
.Name = "Sheet2"
.cells.ClearContents
endwith
endwith
...

>Thanks, that almost works. It copies the cells but NOT the header/footer stuff.
>Peter
>
>
>>Something like:
>>with oExcel
>>.Activesheet.Cells.Select
>>.Selection.Copy
>>.ActiveWorkbook.Worksheets.add(,.ActiveWorkbook.sheets(1))
>>xlFormats=-4122
>>.Selection.PasteSpecial(xlFormats)
>>.....
>>
>>>Hi
>>>
>>>I created an Excel workbook with a single sheet which I have formatted to my liking.
>>>(Header/footer, cells bold, etc.)
>>>
>>>No I have a procedure which uses this template and adds worksheets as needed. They are unformatted. Is there a way to copy the formatting from sheet1 to the new sheet2?
>>>
>>>
>>>Thanks
>>>
>>>
>>>Peter
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform