Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft Excel is present?
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00463215
Message ID:
00465638
Views:
14
>ANother trick
>**********

More trick
*----------------------------------------------------
* FUNCTION BuscaExcel
*----------------------------------------------------
* Busca si Excel está instalado
* RETORNO: .T. Si Excel está instalado
* USO: ? BuscaExcel
*----------------------------------------------------
FUNCTION BuscaExcel
	LOCAL lcArchivo, lc, lcRutaExe, llRet

	*--- Creo un archivo .xls
	lcArchivo = SYS(5) + "\" + SYS(3) + ".xls"
	STRTOFILE("*", lcArchivo, .T. )

	lc = SPACE(0)
	lcRutaExe = SPACE(128)
	llRet = .F.

	DECLARE INTEGER FindExecutable IN shell32 ;
		STRING @lcArchivo, ;
		STRING @lc, ;
		STRING @lcRutaExe

	*--- Busco el archivo asociado a .xls
	IF FindExecutable(@lcArchivo, @lc, @lcRutaExe) > 32
		IF "EXCEL.EXE" $ UPPER(lcRutaExe)
			llRet = .T.
		ENDIF
	ENDIF
	DELETE FILE (lcArchivo)
	RETURN llRet
ENDFUNC

*----------------------------------------------------
Luis María Guayán
Tucumán, Argentina
________________________________
SysOp de www.PortalFox.com
Nada corre como un zorro
________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform