I'm trying to call a batch file that uses SFTP. If I double-click the batch file, it FTP's successfully. But when trying to call that .bat through VBA, I either receive strange errors or no error at all.
Method:
lShellResults = objShell.Run("R:\directory\SendSFTP.bat", 7, False)
Results:
"Automation error. No application is associated with the specified file for this operation.
-----------------------------------------------
Method:
shell "cmd /c R:\directory\SendSFTP.bat", vbNormalFocus
Results:
CMD window pops up and closes immediately. Goes to next line of code and does not upload file.
-----------------------------------------------
Again, the scripts sends successfully when double-clicking, but I cannot get it to work through VBA. Code compiles without issue so I'm fairly sure I've declared and set everything correctly.
Thoughts?
Method:
lShellResults = objShell.Run("R:\directory\SendSFTP.bat", 7, False)
Results:
"Automation error. No application is associated with the specified file for this operation.
-----------------------------------------------
Method:
shell "cmd /c R:\directory\SendSFTP.bat", vbNormalFocus
Results:
CMD window pops up and closes immediately. Goes to next line of code and does not upload file.
-----------------------------------------------
Again, the scripts sends successfully when double-clicking, but I cannot get it to work through VBA. Code compiles without issue so I'm fairly sure I've declared and set everything correctly.
Thoughts?