Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Trying to open an Excel file Part 2
Message
De
05/07/2006 16:10:26
 
 
À
05/07/2006 16:03:28
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01133976
Message ID:
01133978
Vues:
13
This message has been marked as the solution to the initial question of the thread.
Re: Determine if worksheet already exists in Excel Thread #1033660 Message #1033666


>The reason I'm "trying to open an Excel file" is to make sure the first worksheet is of the proper name, otherwise rename it (or just rename it anyway) so when I pull information from that file I can properly reference which worksheet to use.
>
>I may be trying to go about this in an awkward way...
>
>****New code to change workbook name START
> oleApp = Createobject("Excel.Application") && Start Excel.
> oleApp.Workbooks.Open.FILENAME:=(&xlsfile)
> oleApp.Sheets("Sheet1").Select
> If oleApp.Sheets("Sheet1").Name = "Sheet1"
> oleApp.Sheets("Sheet1").Name = "new order file"
> Endif
> If oleApp.Sheets("NOF").Name = "NOF"
> oleApp.Sheets("NOF").Name = "new order file"
> Endif
> oleApp.ActiveWorkbook.Save
> oleApp.ActiveWindow.Close
> oleApp.Quit &&Quit Excel
>****New code to change workbook name END
>
>...and I'm still not sure it will respond correctly once it does recognize the xlsfile.
>
>Thanks!
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform