LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
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
Shell function problem (MS Access) mabond Excel Programming 6 June 8th 07 11:35 AM
Problem with Shell command Andrew Hall NZ Excel Programming 14 December 21st 06 06:27 PM
Shell Problem Stuart[_29_] Excel Programming 1 December 10th 05 12:00 PM
Shell Stuart[_20_] Excel Programming 1 February 17th 05 01:50 AM
Problem using Excel's "Shell" command Jim Simpson Excel Programming 0 May 20th 04 06:28 PM


All times are GMT +1. The time now is 06:21 AM.

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"