Bat file will not run

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,832
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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Well after a few attempts i have it now working.

Didnt have the path 100% correct.

Thanks
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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