View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Excel 2007 Macro w/ AppActivate = Run-time error '5': Invalid procedure call or argument

Why not just use

Dim ReturnValue As Long
ReturnValue = Shell("c:\windows\system32\ping.exe -t 4.2.2.2",
vbNormalFocus)


Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Sat, 25 Apr 2009 15:38:12 -0700, "Per Moeller-Olsen"
wrote:

Greetings,

Any clue why we get this in an Excel 2007 macro, see below.

Run-time error '5': Invalid procedure call or argument

when running the macro below. The ping starts & runs fine, it's just we get
the error message?

Per...

Sub X_x()
'
' X_x Macro
'
' Keyboard Shortcut: Ctrl+x
'
Dim ReturnValue
ReturnValue = Shell("c:\windows\system32\ping.exe 4.2.2.2 -t")
AppActivate ReturnValue
End Sub