Bat file will not run

ipbr21054

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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Well after a few attempts i have it now working.

Didnt have the path 100% correct.

Thanks
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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