Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Microsoft Excel from VFP
Message
De
29/12/1997 13:53:55
 
 
À
29/12/1997 13:40:35
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00067923
Message ID:
00068286
Vues:
25
>>>>>>In my reporting section, I'm giving a option of transferring reports to excel..
>>>>>>
>>>>>>Here, I am simply redirecting the output to a txt file and then starting excel with the txt file name as the command line parameter...
>>>>>>
>>>>>>I have questions for the same :-
>>>>>>
>>>>>>1. Is there any way I can retrieve the Path of Microsoft Excel, so I can provide it in the run parameter..
>>>>>>as on every machine it is not sure that its installed in same dir..
>>>>>>
>>>>>>2. Is there any better way to do this whole thing...
>>>>>Check for OLE automationin help and solutions sample and createobject, getobject etc.
>>>>>Cetin
>>>>
>>>>Pls note that I'm Using VFP 3.0b, Can u pls tell me where is the example given for Excel ??
>>>Sorry Vinod noticed this reply just now. There is an example for 3.0 too. It is in ..\vfphome\samples\ole and named oleaut1.scx
>>>Here is an example from "Hacker's Guide to VFP 3.0" by Granor and Roche :
>>>
>>>Parameters cFileName
>>>Declare Integer FindWindow in Win32API String lpClassName, String lpWindowName
>>>If FindWindow("XLMAIN",.NULL.) 0 && Application running
>>> oXL = getobject(,"Excel.application") && Get a reference to it
>>> oXL.FileOpen(cFileName)
>>>else
>>> oXL = createobject(cFileName,"Excel.Application")
>>>endif
>>>
>>
>>You should be able to get the directory path for Excel (or any other registered application) by using the GetProfileString API function. I'm not at my desk right now, but will be later in the day. When I get there I'll log back on and post you an example of using this function to retrieve the type information you want.
>>
>>I don't know of a reference that specifically addresses the syntax required to use this in VFP. However, both Christine Solomon's book (Microsoft Office Developer's Guide or something very similar to that) and Dan Appleman's book, (Visual Basic Programmer's Guide to the Win32 API) should be very helpful.
>>
>>Anyway, I will post you an example a little later today.
>>
>>Best wishes,
>>
>>Jim Hart
>Hi Jim,
>Problem was not getting path to Excel, instead if there is a need for it or not. There isn't a need to know the path, registry knows. So createobject, getobject, addobject etc was all needed.
>Thanks for addition.

Cetin,
He is in VFP 3.0b, working with 3.1 clients.. No registry..

Thanx!

tony MIller
Vancouver,Wa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform