Post by Tiziano MarmiroliPost by paccioavrei la necessità che un comando di una userform chiudesse un '
applicazione esterna ad excel (nel caso in spece e' il programma di
connessione telefonica).
qualcuno sa dirmi come fare?
Newsgroups: microsoft.public.it.office.excel
Subject: Chiudere altra aaplicazione da excel
Date: Fri, 18 Mar 2005 12:38:33 +0100
http://www.google.it/groups?threadm=8afl31t07e4unn8bjr7l806evgc8sq1drd%404ax.com
ho provato, ma mentre riesco a farlo per qualunque combinazione non riesco
a farlo per quella del combinatore telefonico. la parte del combinatore è::
------------------------------------------
Option Explicit
Private Declare Function tapiRequestMakeCall& Lib "TAPI32.DLL" (ByVal
DestAddress$, ByVal AppName$, ByVal CalledParty$, ByVal Comment$) 'Questa
è tutta una riga
Private Const TAPIERR_NOREQUESTRECIPIENT = -2&
Private Const TAPIERR_REQUESTQUEUEFULL = -3&
Private Const TAPIERR_INVALDESTADDRESS = -4&
----------------------------------------------
Private Sub cmdDial_Click()
'controllo se la textbox1 è vuota, allora avviso ed esco dalla routine
If TextBox1 = "" Then
MsgBox "Seleziona il Nominativo da chiamare o scrivi un numero di telefono"
Exit Sub
End If
Dim buff As String
Dim nResult As Long
'Invoke tapiRequestMakeCall. If tapiRequestMakeCall returns 0, the
'request has been accepted. It is up to the call manager application
'to do any further work. The second-to-last argument should be
'changed to be the name of the person you are dialing.
'riga sotto: modifica con TextBox1(casella dove si trova il numero da
chiamare) assegnata a nResult
nResult = tapiRequestMakeCall&(Trim$(TextBox1), CStr(Caption), "Test
Dial", "")
'Display message if error
If nResult <> 0 Then
buff = "Error dialing number : "
Select Case nResult
Case TAPIERR_NOREQUESTRECIPIENT
buff = buff & "No Windows Telephony dialing application is running and
none could be started."
Case TAPIERR_REQUESTQUEUEFULL
buff = buff & "The queue of pending Windows Telephony dialing requests is
full."
Case TAPIERR_INVALDESTADDRESS
buff = buff & "The phone number is not valid."
Case Else
buff = buff & "Unknown error."
End Select
MsgBox buff
End If
End Sub
------------------------------------------
e tutto questo funziona ma resta aperto quando esco dalla user form
speravo di poter attivare il programma e quindi cancellarlo con
SendKeys "%{F4}", True
ma non ci sono riuscito
grazie dell' aiuto
dovrei capire cosa
--
c' e' tutto il tempo per diventare ancora piu'
ignoranti