Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More Fun with Excel OLE
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00205681
Message ID:
00205754
Vues:
13
>First, thanks for the kind words. Here's what you need. Assume in the following snippet that lcfile represents an existing file and includes the path. If there isn't a file, I'd suggest that you create one with FCREATE() in the default directory. It doesn't have to have any info in it. In other words in can be 0 bytes long, just as long as the extension is one recognized as an Excel extension, like XLS. Now in VFP 6.0 (or 5.0 with Foxtools loaded)
>LOCAL lnresult
>DECLARE INTEGER FindExecutable IN Shell32;
>  STRING @lcfile, STRING @lcpath, STRING @lcresult
>lcpath = JUSTPATH(lcfile)
>lcresult = SPACE(260)
>lnresult = FindExecutable(@lcfile, @lcpath, @lcresult)
>If lnresult = 31, there's no application associated with that file. If it's greater than 32, lcresult will contain the fully qualified file name. If you need to strip the extra spaces: lcresult = LEFT(lcresult, AT(CHR(0), lcresult) - 1).

I placed a dummy XLS on the server where the DB is stored, then test it:

nretval = FindExecutable("dummy.xls",UNC server path, @buffer)

Seems to work fine...I guess all I need is to check the return code for this situation...

Thanks, George, I think I'm in business now.
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform