Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is there a way to "dial" a number that is listed in Excel?

140 views
Skip to first unread message

bruj

unread,
Dec 27, 2001, 9:57:35 PM12/27/01
to
I have a xls (no forms or anything else). I would like to select a phone
number and the dial it.
Hardware wise, I imagine I would need to hook the modem up between the phone
and the wall.
I have a DOS dialler YEARS agao and miss that little puppy, but now it is a
matter of that I really really need this function.

Are there gong to be any other modules, and if so, where can I get them.

Thanks
Bruce

Vasant Nanavati

unread,
Dec 27, 2001, 10:23:56 PM12/27/01
to
Hi Bruj:

Search Google Groups with keywords "dial phone" and newsgroups
"*excel.programming". There have been a number of (lengthy) solutions
proposed over the years.
--
Regards,

Vasant.


"bruj" <br...@attbi.com> wrote in message
news:zcRW7.9899$7p6.1...@rwcrnsc51.ops.asp.att.net...

Don Guillett

unread,
Dec 28, 2001, 6:33:42 PM12/28/01
to
Sub CellToDialer() 'John Walkenbach
' Transfers active cell contents to Dialer
' And then dials the phone

' Get the phone number
CellContents = ActiveCell.Value
If CellContents = "" Then
MsgBox "Select a cell that contains a phone number."
Exit Sub
End If

' Activate (or start) Dialer
Appname = "Dialer"
AppFile = "Dialer.exe"
On Error Resume Next
AppActivate (Appname)
If Err <> 0 Then
Err = 0
TaskID = Shell(AppFile, 1)
If Err <> 0 Then MsgBox "Can't start " & AppFile
End If

' Transfer cell contents to Dialer
Application.SendKeys "%n" & CellContents, True

' Click Dial button
Application.SendKeys "%d"
' Application.SendKeys "{TAB}~", True
End Sub


--
Don Guillett
SalesAid Software
Granite Shoals, TX
don...@281.com


bruj <br...@attbi.com> wrote in message
news:zcRW7.9899$7p6.1...@rwcrnsc51.ops.asp.att.net...

Orlando Magalhães Filho

unread,
Dec 30, 2001, 11:33:36 PM12/30/01
to
Hi,

Create a module and insert the code below. Suppose you have names on sheet
column 1 and phones numbers on column 2, select one row and run the Dialer.


Declare Function tapiRequestMakeCall Lib "tapi32.dll" _
(ByVal stNumber As String, ByVal stDummy1 As String, _
ByVal stDummy2 As String, ByVal stDummy3 As String) As Long
Public Const ID_CANCEL = 2
Public Const MB_OKCANCEL = 1
Public Const MB_ICONSTOP = 16, MB_ICONINFORMATION = 64

Sub Dialer()
ColName = 1
ColPhone = 2
vRow = Selection.Row - 1
If vRow = 0 Then Exit Sub
DialNumber Range("A1").Offset(vRow, ColPhone - 1).Value,
Range("A1").Offset(vRow, ColName - 1).Value
End Sub


' ***********************************************************
' FUNCTION: DialNumber()
'
' PURPOSE: To dial a telephone number using the computer's modem
'
' ARGUMENTS:
' PhoneNumber: The telephone number to dial
'
' EXAMPLE:
' Type the following in the Debug window to dial a phone number:
'
' ? DialNumber("555-1212")
'
' About this code see Microsoft knowledgebase article Q141625
' ***********************************************************
Function DialNumber(PhoneNumber, Optional vName As Variant)
Dim Msg As String, MsgBoxType As Integer, MsgBoxTitle As String
Dim RetVal As Long
' Ask the user to pick up the phone.
Msg = "Please pickup the phone and click OK to dial " _
& Chr(13) & Chr(13) & PhoneNumber & " " & vName
MsgBoxType = MB_ICONINFORMATION + MB_OKCANCEL
MsgBoxTitle = "Dial Number"
If MsgBox(Msg, MsgBoxType, MsgBoxTitle) = ID_CANCEL Then
Exit Function
End If
' Send the telephone number to the modem.
RetVal = tapiRequestMakeCall(PhoneNumber, "", vName, "")
If RetVal < 0 Then
Msg = "Unable to dial number " & PhoneNumber
GoTo Err_DialNumber
End If
Exit Function
Err_DialNumber: 'This is not an On Error routine.
Msg = Msg & Chr(13) & Chr(13) & _
"Make sure no other devices are using the Com port"
MsgBoxType = MB_ICONSTOP
MsgBoxTitle = "Dial Number Error"
MsgBox Msg, MsgBoxType, MsgBoxTitle
End Function

HTH


"bruj" <br...@attbi.com> escreveu na mensagem
news:zcRW7.9899$7p6.1...@rwcrnsc51.ops.asp.att.net...

0 new messages