Dial Phone from Active Excel Cell

  • Thread starter Thread starter Wayfarer
  • Start date Start date
W

Wayfarer

I'd like to dial a phone number contained in the current cell in
Excel 2003. I have a voice modem. I've Googled and searched
microsoft.com and I can't find it anywhere, if it's possible at
all. I've see shareware that makes it possible, but if I can't
do it for free I'll live with it. Can anyone enlighten me?

TIA

Neill
 
Neill, try this.

Sub CellToDialer()
'Here's some VBA code from John Walkenbach "Excel 2000 Power Programming
With VBA" book.
'It uses SendKeys to click the Dial button:

' 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"
End Sub


--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2002 & 2003
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top