Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Load Excel template
Message
De
09/06/2005 12:24:56
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
09/06/2005 11:13:03
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01021794
Message ID:
01021842
Vues:
21
This message has been marked as a message which has helped to the initial question of the thread.
I have used templates more in Word than in Excel, but I think it is the same idea: You normally don't open a template, to save it with a different name; instead, you directly create a new file, based on the template. I think that would be with the .Add() method.

Now, this is for the end-user, to avoid accidentally overwriting the template with the modified version. For programmatic control, your code should work just as well. But .Add() might be simpler (one line for creating the document, one for saving it, instead of your 4 lines of code) - if it works.

>Thanks Hilmar. I actually got it, now. In case somebody might want to see the code, here's how I did it.
>
>excel = createobject('Excel.Application')
>excel.Workbooks.Open('mytemplate.xlt')
>excel.ActiveWorkbook.SaveAs('newexcelfile.xls')
>excel.ActiveWorkbook.Close()
>excel.Workbooks.Open('newexcelfile.xls)
>
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform