Can excel dial phone numbers ???

tnagaway

New Member
Joined
Oct 25, 2003
Messages
18
Hi ,
can excel be made to dial phone numbers in an excel worksheet ? , i have a sheet containing customer phone number, and i want to be able to call them directly from excel ....
:wink:
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
From http://winsolutions.port5.com/art01a.html
How to use Excel as Phone Dialer

Here we will use TAPI to make outbound calls. We can make use of TAPI easily with any VBA compliant application e.g. Microsoft Excel, Access etc. or Visual Basic.

It's really quite easy to add outbound dialing to any Excel spreadsheet. Since you only need one API call (tapiRequestMakeCall), you have very little code to deal with.All you need is a single declare statement to cover the API call and one subroutine to handle the details of gathering the phone number from the user and calling the API function.

Start Excel and/or open a new workbook. Since you'll be doing a bit of coding, be sure that the Visual Basic toolbar and the Forms toolbar are visible. If not, select View | Toolbars and then place a check mark next to Visual Basic and Forms.

The first thing you need to do is add the TAPI function declaration. To do this you must first add a code module to the project. Select Insert | Macro | Module from the main menu or click on the Insert Module icon in the Visual Basic toolbar. Once the module has been added to the project, rename the tab to VBA Code. Now insert the following code :

Listing 1.1

'
' declare assisted-tapi function
'
Declare Function tapiRequestMakeCall Lib "TAPI32.DLL" (ByVal lpszDestAddress As String, ByVal lpszAppName As String, ByVal lpszCalledParty As String, ByVal lpszComment As String) As Long

Now you need to add a small subroutine that will determine the cell selected by the user, locate the associated phone number and then place the call using the TAPI function declared in Listing 1.1. Listing 1.2 shows the code needed for this routine. Place this code in the same module that contains the API declare.



Listing 1.2

'
' call number in active cell
'
Sub CallBtn()
Dim x As Long ' for return
Dim cPhone As String
Dim cName As String
'
cName = ActiveCell
cPhone = ActiveCell.Offset(0, 1)
'
x = tapiRequestMakeCall(cPhone, "", cName, "")
'
End Sub

Now all you need to do is lay out the worksheet page to contain the name/phone number pairs. Use the Create Button icon from the Forms toolbar to add the button to the worksheet. When you are prompted to enter the macro associated with this button, be sure to enter the name of the subroutine shown in Listing 1.2 (CallBtn). It doesn't matter where you place things on the form. Just be sure to arrange the Name and Phone columns next to each other. The CallBtn subroutine will only work if the two columns are arranged side-by-side in the proper order.

Save the file as MyDialer.xls and then highlight a name and press the Call button. You should hear the modem in your pc dialing the number and see a dialog box on your screen.

Or a freeware application:

http://merci001.tripod.com/

Hope that helps,

Smitty
 
Upvote 0
But, how to attach a voice file, so instead of talking, the person will hear a pre-recorder msg?
 
Upvote 0
I get the following error message when I used this code. It appears in the call window when the moden trys to call: "failed wrong number or the called device is out of service" Any ideas what I did wrong? Outlook will call with no issues. I can also fax out too with no issues.
 
Upvote 0
From http://winsolutions.port5.com/art01a.html

Or a freeware application:

http://merci001.tripod.com/

Hope that helps,

Smitty

Smitty just sent me the fix to dial from Excel 2016. You must declare the Ptr Safe Function to make this work in Excel 2016.

Code:
' declare assisted-tapi function
'
Declare PtrSafe Function tapiRequestMakeCall Lib "TAPI32.DLL" _
(ByVal lpszDestAddress As String, ByVal lpszAppName As String, _
ByVal lpszCalledParty As String, ByVal lpszComment As String) As Long

' call number in active cell
'
Sub CallBtn()
Dim x As Long ' for return
Dim cPhone As String
Dim cName As String
'
cName = ActiveCell
cPhone = ActiveCell.Offset(0, 1)
'
x = tapiRequestMakeCall(cPhone, "", cName, "")
'
End Sub

Thanks Smitty!
 
Upvote 0
Smitty just sent me the fix to dial from Excel 2016. You must declare the Ptr Safe Function to make this work in Excel 2016.

Code:
' declare assisted-tapi function
'
Declare PtrSafe Function tapiRequestMakeCall Lib "TAPI32.DLL" _
(ByVal lpszDestAddress As String, ByVal lpszAppName As String, _
ByVal lpszCalledParty As String, ByVal lpszComment As String) As Long

' call number in active cell
'
Sub CallBtn()
Dim x As Long ' for return
Dim cPhone As String
Dim cName As String
'
cName = ActiveCell
cPhone = ActiveCell.Offset(0, 1)
'
x = tapiRequestMakeCall(cPhone, "", cName, "")
'
End Sub

Thanks Smitty!

I have tried this but when I dial, it does not go through. Says I should lift the receiver and click to talk. Then shows no answer. Any idea what's wrong?
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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