Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Excel DefaultFilePath inconsistent
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01098511
Message ID:
01098582
Vues:
13
Is there a way to set the folder location of the SAVEAS dialog for the current workbook - in code?

>Brenda,
>
>As far as I know, the DefaultFilePath is not the path the OS system use for the SaveAS dialog. In the Files dialogs OS (not Excel) keeps the very last directory used for saving the file. And it will appear in any other subsequent FILE dialog unless you close Excel and open it again. Then the path in the SaveAs dialog will be set to Excel default path.
>
>The default path you can set in the Tools-->Options-->General-->Default File Location.
>
>To make sure that you saveAS file in proper directory, provide the the file fullpath to SaveAS.
>
>
>
>
>
>>I create an Excel workbook and launch Excel in my code. The oExcel DefaultFilePath does not always set the FILE->SAVE AS folder location. I have run the following code in the Command window and the pattern seems to be the first time that I change the location, it keeps the old location. Then if I run the code again, it now has in the FILE->SAVE AS the new folder location. When I am in Excel I am doing nothing other than looking at the FILE->SAVE AS and then closing the application.
>>
>>
>>site_id = '10'
>>cDirectory = rpath + '\Query_Maker\r' +ALLTRIM(site_id)+'\'
>>RELEASE oexcel
>>oExcel = CREATEOBJECT('Excel.Application')
>>oExcel.DefaultFilePath = cDirectory
>>oExcel.Workbooks.Add
>>oexcel.Visible = .t.
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform