Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Running Excel from VFP App
Message
From
05/05/2006 19:22:45
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/05/2006 19:18:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01119766
Message ID:
01119816
Views:
19
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform