Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Running Excel from VFP App
Message
De
05/05/2006 19:22:45
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/05/2006 19:18:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01119766
Message ID:
01119816
Vues:
20
>I allmost resolved the problem, I need only one thing more...
>
>When I use
>
>oExcel = createobject("Excel.application")
> with oExcel
> .Workbooks.Open("C:\estaib\archivos\abril2006.xls")
> .visible = .t.
>I´m sure that the computer has intalled the software, but what happen if the compuiter doesn´t has the Excel installed, how can I check it...???
if !IsClassRegistered("Excel.Application")
messagebox("Excel is not installed")
else
*...
endif

function IsClassRegistered
lparameters tcClass
#DEFINE HKEY_CLASSES_ROOT    -2147483648
#DEFINE ERROR_SUCCESS		0	&& OK

DECLARE Integer RegOpenKey IN Win32API ;
	Integer nHKey, String @cSubKey, Integer @nResult

DECLARE Integer RegCloseKey IN Win32API ;
	Integer nHKey

local lnKey
lnKey = 0
llRetVal = ( RegOpenKey(HKEY_CLASSES_ROOT, tcClass, @lnKey) = ERROR_SUCCESS )
if llRetVal
  RegCloseKey(lnKey)
endif
return llRetVal
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform