Thread: Shell Problem
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Shell Problem

I am having trouble getting Paint started:

Sub paint1()
Dim ReturnValue, i
ReturnValue = Shell("C:\WINDOWS\system32\mspaint.exe", 1)
AppActivate ReturnValue
End Sub

Raises a run time error 5

Sub paint2()
Dim ReturnValue, i
ReturnValue = Shell("C:\WINDOWS\system32\mspaint.exe", 1)
MsgBox (ReturnValue)
AppActivate ReturnValue
End Sub

Works just fine. Why do I need the MsgBox() before the AppActivate??

--
Gary''s Student - gsnu200755