Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Relative paths and office 2013
Message
 
 
À
12/11/2015 10:41:32
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01627367
Message ID:
01627380
Vues:
53
J'aime (1)
You shouldn't use relative path in such cases because you have no idea what default path for application you are controlling through automation is. It used to work because, by coincidence, application default directory used to match VFP default directory. Bottom line, always use full path.

>
>After reinstalling VFP on a new machine with Office 2013, I got into very strange situation where OLE automation will no longer
>accept relative paths. The same code was working ok past 10 years.
>
>It is happening only in development mode (inside VFP ide) when compiled into EXE everything works ok.
>
>
>
>cFile='\templates\some.xls'
>if file(cFile)  &&file does exist!
>  oXl.workbooks.open(cFile)      &&Cannot find file
>  .
>  ****BUT
>  .  
>  cFile='c:\templates\some.xls'
>  oXl.workbooks.open(cFile)      &&Opens ok
>
>  .
>
>
>
>The same goes for outlook object attaching file with relative path. As if it applies for all office (or OLE automation with office) .
>Did not try word or anything else.
>
>What am I missing here ?
>Anybody have any idea why is this happening ?
>
>
>TIA
>Sergio
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform