ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dialer wont start (https://www.excelbanter.com/excel-programming/315384-dialer-wont-start.html)

Pat

Dialer wont start
 
The following code works fine under WindowsME but will not run in WindowsXP.
The message I am getting when the code is run is "Cannot start Dialer.exe"
The message has an OK option only and whae clicked will not stop the code
from running. The only course of action is to close down Excel via the Task
Manager.



Private Sub CommandButton1_Click()
CellContents = Cells(ActiveCell.Row, "AB").Value
If CellContents = "" Then
MsgBox "Select a cell that contains a phone number."
Exit Sub
End If
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

Application.SendKeys "%n" & CellContents, True

Application.SendKeys "%d"
End Sub



Jim Cone

Dialer wont start
 
Pat - hello again,

Two things...

1. You are missing part of the code - "exit sub" - is one part, full file path is another.
2. XP is different

Take a look at this...
http://groups.google.com/groups?thre...FTNGP11&rnu m

Regards,
Jim Cone
San Francisco, CA


"Pat" wrote in message ...
The following code works fine under WindowsME but will not run in WindowsXP.
The message I am getting when the code is run is "Cannot start Dialer.exe"
The message has an OK option only and whae clicked will not stop the code
from running. The only course of action is to close down Excel via the Task
Manager.


Private Sub CommandButton1_Click()
CellContents = Cells(ActiveCell.Row, "AB").Value
If CellContents = "" Then
MsgBox "Select a cell that contains a phone number."
Exit Sub
End If
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
Application.SendKeys "%n" & CellContents, True
Application.SendKeys "%d"
End Sub



All times are GMT +1. The time now is 05:17 AM.

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