P
Paul B
TimeKeeper,
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
And if you are new to macros you may also what to have a look here on
getting started with macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
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
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
And if you are new to macros you may also what to have a look here on
getting started with macros
http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
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