Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Activate MS Excel
Message
De
26/06/2002 18:21:00
 
 
À
26/06/2002 15:46:03
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00672648
Message ID:
00672712
Vues:
10
Mike,
Strange. I thought that if you set visible to .t., Excel receives focus. Anyway, you could use some API functions to switch between the instances. Try something like this:
DECLARE INTEGER FindWindow IN Win32api STRING, STRING
DECLARE SetForegroundWindow IN Win32api INTEGER 

*-- get VFP handle
lnVfpHandle = FindWindow(.NULL., _screen.caption)

oXls=CREATEOBJECT("excel.application")
oXls.Visible=.t.

*-- get XLS handle
lnXlsHandle = FindWindow(.NULL., oXls.caption)

*-- set focus the Excel instance
SetForegroundWindow(lnXlsHandle)

*-- set focus to VFP instance
SetForegroundWindow(lnVfpHandle)
>Hi All
>
>I've started up Excel from VFP, filled in a few cells, made Excel visible, but I can't seem to find a way to set the focus on the Excel instance.
>
>How is that done programmatically?
>
>Thanks!
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform