Bat file will not run

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,226
Office Version
  1. 2007
Platform
  1. Windows
I have a working Bat file which i run from an image on my userform.

Today i needed to add another image & also a Bat file.
I copied the original Bat file code but made an just changed the path etc to reflect the new programme.

My problem is when i click on the image nothing happens in respect of the programme running.
I do see a message.
Method run of object IWishShell3 Failed.

In the Bat file i have the following.
Code:
echo
"C:\AutoDisc\epc\.exe"

The macro code on my image is shown below.
Code:
Sub OpenAutodisc()Set WshShell = CreateObject("WScript.Shell")
WshShell.Run Chr(34) & "C:\Autodisc\epc.Bat" & Chr(34), 0
Set WshShell = Nothing


End Sub

When i debug this line is shown in yellow.
Code:
WshShell.Run Chr(34) & "C:\Autodisc\epc.Bat" & Chr(34), 0
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Well after a few attempts i have it now working.

Didnt have the path 100% correct.

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,590
Messages
6,120,421
Members
448,961
Latest member
nzskater

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top