mikelokan Posted May 5, 2011 Share Posted May 5, 2011 I have a working VBA program that was developed for XP. We are starting to upgarde to W7 and one of the users ran my program and received the error "Run-time error '-2147024893 (80070003)': Method 'Run' of object 'IWshShell3' failed" The code that created the error: Set objShell = CreateObject("WScript.Shell") objShell.Run "N:\Shared\TOandPGI\TOCounter.vbs"Thanks in advance for any help - Mike Link to comment Share on other sites More sharing options...
Yzöwl Posted May 5, 2011 Share Posted May 5, 2011 have you thought of changing the code to readSet objShell = CreateObject("WScript.Shell")objShell.Run Chr(34) & "N:\Shared\TOandPGI\TOCounter.vbs" & Chr(34) The error code I think means The system cannot find the path specified. therefore if the additional double quotes doesn't work then I'd suggest you check that the path is actually correct, (most likely an incorrect shared drive letter). Link to comment Share on other sites More sharing options...
gunsmokingman Posted May 5, 2011 Share Posted May 5, 2011 You could try this VBS script.1:\ Checks For File Exists2:\ If Missing Error Mesage3:\ If Exists It Should Run The File.'-> Path To FileDim File :File="N:\Shared\TOandPGI\TOCounter.vbs"'-> Check Before We Run If CreateObject("Scripting.FileSystemObject").FileExists(File) Then CreateObject("Wscript.Shell").Run(Chr(34) & File & Chr(34)),1,True Else MsgBox "Error Can Not Find This File" & vbCrLf & _ File,4128,"Error Missing File" End If Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now