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

Dialing from a cell

9 views
Skip to first unread message

Bruce

unread,
Feb 5, 2003, 5:57:36 PM2/5/03
to
I got some help here last month with this and it was working on my ME
system, but I got a new laptop with WinXP, and now when the module is
called, it will call up dailer, but just sit the (I had to put the full path
in the code for it even to do that...

Code as I have it is:

Sub CellToDialer() 'John Walkenbach
' Transfers active cell contents to Dialer
' And then dials the phone
' Modified by Jim Cone on Jan 18, 2002

Dim CellContents As String 'JBC
Dim AppName As String 'JBC
Dim AppFile As String 'JBC
Dim TaskID As Variant 'JBC

' Get the phone number
CellContents = ActiveCell.Value
If CellContents = "" Then
MsgBox "Select a cell that contains a phone number.", _
vbInformation 'JBC
Exit Sub
End If
' Activate (or start) Dialer
AppName = "Dialer"
' USE THE FULL FILE PATH APPLICABLE TO YOUR OPERATING SYSTEM 'JBC
AppFile = "C:\Program Files\Windows NT\dialer.exe" 'JBC
On Error Resume Next
' This activates the dialer if it showing on the desktop 'JBC
AppActivate (AppName)
If Err.Number <> 0 Then
Err = 0
' This activates the dialer by opening(running) the file 'JBC
TaskID = Shell(AppFile, vbNormalFocus)
If Err <> 0 Then
MsgBox "Can't start " & AppFile, vbExclamation 'JBC
Exit Sub 'JBC
End If 'JBC
End If

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

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

' Selects the next telephone number in the column. 'JBC
ActiveCell(2, 1).Select 'JBC
' The macro button must now be clicked twice to dial the next 'JBC
' number in the column.
End Sub


Thanks!


Matt Williamson

unread,
Feb 6, 2003, 10:00:53 AM2/6/03
to
Bruce-

Have you stepped through the code to see what is happening at what time?
You're ignoring errors with the "On error resume next", I'd rem that out and
run the code and see if it bombs. If it does, you'll know where the problem
lays.

Sendkeys is quirky at best, especially when going to a different OS. If you
want the function to be that portable, I'd re-write it using API to send the
messages to the appropriate windows. You could use keybd_event or
SendMessage/Postmessage to do it. Tons of examples of this on the web and in
the VB groups.

HTH

-Matt

"Bruce" <Br...@reliv4us.com> wrote in message
news:AFg0a.2339$Ec4....@rwcrnsc52.ops.asp.att.net...

Jim Cone

unread,
Feb 6, 2003, 10:48:33 PM2/6/03
to
Bruce,

The code didn't work for me either when I switched from NT 4.0 to Windows XP.
I copied the following six files from NT 4.0 to XP and it worked...

dialer.cnt
dialer.exe
dialer.FTS
dialer.GID
dialer.hlp
DIALER.INI

Regards,

Jim Cone
San Francisco, CA
jim.c...@rcn.comXXX
*****************************************************


"Bruce" <Br...@reliv4us.com> wrote in message
news:AFg0a.2339$Ec4....@rwcrnsc52.ops.asp.att.net...

0 new messages