Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default XP Problems with SendKeys - dialing a number in an Excel cell

Application.SendKeys "%n" & CellContents, True
The above part of the following code does not function in WindowsXP, why
Microsoft makes it so difficult to use this feature is beyond me. It works
fine on another computer running WindowsME.

Private Sub TestDialer_Click()
' Transfers active cell contents to Dialer
' And then dials the phone
' Modified by Jim Cone on Jan 18, 2002
' Changed AppFile path on Apr 19, 2003

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

' Get the phone number
CellContents = ActiveCell.Value
If Len(CellContents) < 7 Then
MsgBox "Select a cell that contains a phone number.", _
vbInformation
Exit Sub
End If
' Activate (or start) Dialer
AppName = "Dialer"
' USE THE FULL FILE PATH
' AppFile = "C:\Program Files\Windows NT\dialer.exe"
' AppFile = "C:\Old Telephone Dialer\dialer.exe"
AppFile = "C:\Windows\dialer.exe"
On Error Resume Next
' This activates the dialer if it is showing on the desktop
AppActivate (AppName)
If Err.Number < 0 Then
Err = 0
' This activates the dialer by opening(running) the file
TaskID = Shell(AppFile, vbNormalFocus)
If Err < 0 Then
MsgBox "Can't start " & AppFile, vbExclamation
Exit Sub
End If
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.
' ActiveCell(2, 1).Select
' The macro button must now be clicked twice to dial the next
' number in the column.

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default XP Problems with SendKeys - dialing a number in an Excel cell

Multiple posts will just irritate the people who might have answers for you.

It been a long time since I did any phone dialing from Excel.
The original code came from John Walkenbach and to make it work you need the
dialer files from Windows NT (WindowsME?) or other older versions of Windows...

"dialer.cnt, dialer.exe, dialer.FTS, dialer.GID, dialer.hlp, DIALER.INI" are the
files I copied from Windows NT.

Of course, when you do add the files to your system, you will need to adjust the
file path shown in the code.
--
Jim Cone
Portland, Oregon USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Steve Aa"
wrote in message
Application.SendKeys "%n" & CellContents, True
The above part of the following code does not function in WindowsXP, why
Microsoft makes it so difficult to use this feature is beyond me. It works
fine on another computer running WindowsME.

Private Sub TestDialer_Click()
' Transfers active cell contents to Dialer
' And then dials the phone
' Modified by Jim Cone on Jan 18, 2002
' Changed AppFile path on Apr 19, 2003

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

' Get the phone number
CellContents = ActiveCell.Value
If Len(CellContents) < 7 Then
MsgBox "Select a cell that contains a phone number.", _
vbInformation
Exit Sub
End If
' Activate (or start) Dialer
AppName = "Dialer"
' USE THE FULL FILE PATH
' AppFile = "C:\Program Files\Windows NT\dialer.exe"
' AppFile = "C:\Old Telephone Dialer\dialer.exe"
AppFile = "C:\Windows\dialer.exe"
On Error Resume Next
' This activates the dialer if it is showing on the desktop
AppActivate (AppName)
If Err.Number < 0 Then
Err = 0
' This activates the dialer by opening(running) the file
TaskID = Shell(AppFile, vbNormalFocus)
If Err < 0 Then
MsgBox "Can't start " & AppFile, vbExclamation
Exit Sub
End If
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.
' ActiveCell(2, 1).Select
' The macro button must now be clicked twice to dial the next
' number in the column.

End Sub


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with entering cell number Magda Excel Discussion (Misc queries) 2 September 29th 07 06:12 PM
Telephone dialing in Excel 2003 Wallydog Excel Discussion (Misc queries) 1 December 5th 06 04:13 PM
Am I able to use the dialing feature from numbers in Excel? Lincoln Mike Excel Discussion (Misc queries) 1 November 20th 05 02:41 AM
excel number problems excel man New Users to Excel 1 May 13th 05 06:24 PM
Dialing from Excel Rob van Gelder Excel Worksheet Functions 2 January 25th 05 08:41 PM


All times are GMT +1. The time now is 10:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"