Im having a problem with my excel vba macro. I need it to execute a batch file which is in the same folder as the excel workbook. The code works well sometimes. I don\'t kno
I'm pretty sure the problem is down to this line
Shell "cmd.exe /k cd " & ThisWorkbook.path & "&&code.bat"
You need a space in front of the && to separate it from the cd command and after it to separate it from the code.bat.
&&
cd
code.bat
Shell "cmd.exe /k cd " & ThisWorkbook.path & " && code.bat"