Closing Dialer from Excel

TryingToLearn

Well-known Member
Joined
Sep 10, 2003
Messages
733
I've implemented a phone dialer for this project with code from the board and it works well. The problem is it also opens up the Windows phone dialer. I've attempted to close the dialer with code to no avail. I'm assuming AppActivate doesn't work with 97 which accounts for some of the issues of my code it seems to send the AltF4 to the vb with the return This Command Will Stop The Debugger. If I run the code straight, it doesn't seem to do anything.

Checking on possibilities, I looked at creating an object with dialer but get Active X component can not create
an object (or similar wording).

Any suggestions to close the dialer would be appreciated.

Code:
'In the Userform:

Option Explicit
Public num, nam As String

Private Sub CommandButton1_Click()
    num = TextBox1.Text
    nam = CB1_MemName.Text
    If Len(num) < 10 Then
        MsgBox "Number must be minimum 10 digits", vbCritical, "INVALID NUMBER"
        Exit Sub
    End If
    Call CallBtn(num, nam)
    num = Empty

'        AppActivate "Phone Dialer"
'        Application.SendKeys "%{F4}"
End Sub

'In a module:

Option Explicit
Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal lpszDestAddress As String, ByVal lpszAppName As String, ByVal lpszCalledParty As String, ByVal lpszComment As String) As Long


Sub CallBtn(num, nam)
    Dim x As Long    ' for return
    Dim cPhone As String
    Dim cName As String
    '
    cName = nam
    cPhone = num
    '
    x = tapiRequestMakeCall(num, "", cName, "")
End Sub
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top