Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving and closing Excel file properly
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
01396469
Message ID:
01396626
Vues:
59
1. I'm not sure what the cFichier variable is set to, but the problem could be that the file name is missing a backslash and has a double extension. I would use the FORCEEXT() function just to be safe.
cFichier = "C:\FolderName\FileName.XLS"

* this command sets the variable to "C:\FolderNameFileName.XLS.csv"
cNewFichier = JUSTPATH(cFichier) + JUSTFNAME(cFichier) + ".csv"

* this command sets the variable to "C:\FolderName\FileName.CSV"
cNewFichier = FORCEEXT(cFichier, "CSV")
2. If you want Excel to save the file as a certain type (i.e. CSV, XML, TXT), use the FileFormat parameter.
* this command saves the file as xlCSV
.SaveAs(cNewFichier, 6)
3. If you want to close a document without being prompted to save changes, use the SaveChanges parameter.
* this command closes the document without any prompts to save
.Close(0)
Frank
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform