ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can excel make a phonecall from a cell? (https://www.excelbanter.com/excel-programming/280040-can-excel-make-phonecall-cell.html)

Anders[_5_]

Can excel make a phonecall from a cell?
 
I'm looking for a script that can make excel make a
phonecall from a cell.

I've tried the one from John Walkenbach (www.j-walk.com)
Everything works out fine,
except for the dialer actually dialing the number. I
think the shourtcut key for dialing is just <enter but I
don't know the code for executing that. Right now it is
sending "%d" (ALT-d), but that doesn't do the trick. Any
suggstions? I use winXP and TAPI 3.0. Maybe someone knows
of another script to make this work.


See script below:
-----------------------

Sub CellToDialer()
' 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





All times are GMT +1. The time now is 11:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com