Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Putting info in Excel
Message
 
À
23/06/1999 12:40:43
Information générale
Forum:
Visual FoxPro
Catégorie:
FoxPro 2.x
Divers
Thread ID:
00232500
Message ID:
00233088
Vues:
35
Hi Denise,

Well, this was why I mentioned what I did in my first post. After doing some reasearch, I must admit that I couldn't readily find a way to open the file via DDE. Much more direct, and easier IMHO, is to use the API to open the file and start Excel. Here's the code, straight from the command window of FPW 2.6a. Note that you've got to load Foxtools first.

* Register the API call
m.shellexec = RegFN('ShellExecute', 'I@C@C@C@CI', 'I', 'shell.dll')
* Get an Excel file
m.xlfile = GETFILE('XLS')
m.open = 'open'
m.args = ""
m.path = JustPath(m.xlfile)
* Call ShellExecute - Minimize Excel
m.result = CallFN(m.shellexec, 0, @open, @xlfile, @args, @path, 2)
? m.result && This should be greater than 32 if it works
m.topic = JustFName(m.xlfile) && Get the topic for DDE
m.channel = DDEInitiate("Excel", m.topic) && Establish a channel
? m.channel && This return 0 - Success!
= DDETerminate(m.channel)

Does this help?
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform