ven. 24 juin 2011, 16h37
OlivierH
atoutfox.public.association
Re: Comment tester à partir de foxpro le statut ouvert d'un tableur Excel
Tu lances cette function, (et je t'ai mis des fichiers joint
j'espere que tu accedes au forum par nntp)
*===============================================================
* Procedure test la présence d'un programme
*===============================================================
LPARAMETERS EXTN,APP_NAME
#DEFINE ERROR_SUCCESS 0
#DEFINE C_EXTNOFOUND_LOC "No information available for selectedapplication."
#DEFINE C_NOREGFILE_LOC "The REGISTRY.PRG file needed for this samplecould not be found in \Samples\Classes."
LOCAL cExtn,cAppKey,cAppName,nErrNum,cNewKey
LOCAL oReg,regfile,cVersion
cAppKey = ""
cAppName = ""
IF EMPTY(APP_NAME)
APP_NAME = ""
EndIF
regfile = "registry.prg"
SET PROCEDURE TO (m.regfile) ADDITIVE
oReg = NewObject("FileReg")
* Get Application
nErrNum = oReg.GetAppPath(m.Extn,@cAppKey,@cAppName)
RELEASE PROC (m.regfile)
IF m.nErrNum # ERROR_SUCCESS
*MESSAGEBOX("Le logiciel "+m.cAppName+" n'est pas installé sur votreposte.")
RETURN .F.
ELSE
IF ! APP_NAME $ UPPER(m.cAppName) .And. !EMPTY(APP_NAME)
*MESSAGEBOX("Le logiciel "+APP_NAME+" n'est pas installé sur votreposte.")
RETURN .F.
ELSE
RETURN .T.
EndIF
ENDIF
Le 24/06/2011 14:52, pibounet a écrit :
> Je copie à partir de foxpro dans un tableur Excel.
> Si le tableur est ouvert, je vais faire planter l'application
>
> Je voudrais prévenir l'utilisateur pour qu'il ferme le tableur avant de poursuivre le traitement.
>
> Je connais la fonction file() mais elle teste la présence, pas le caractère ouvert du tableur.
>
> Comment faire ?
>
>
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000006270