I'm working on my first VBA project that requires 12 fields to be manually input of which one field is a file path. I need this path for multiple reasons, but the one reason I'm having a problem with is using the location of the path in conjunction with calling a bat file or executing a cmd prompt that is at that path.
Path Location, minus file name:
Actual Path found in B18:
C:\Users\Nick\Desktop\Submission Tool\Test Files
File attempting to execute:
CopyFileNames.bat
I can manually put all of this together and get what I want by using:
The problem is, every time this will be used, a different path will be used, but the same batch file name will be used. So, rather than having to manually input the file path every time, is there a way to replace "C:\Users\Nick\Desktop\Submission Tool\Test Files" with the cell reference of the path listed above? I've tried different methods of this but I cannot seem to get it.
It would be even better if I could just use the cmd prompt found within the batch and run it directly from vba; the prompt I'm running is as follows:
How can I put that cmd into VBA? I tried different versions of this with no success:
Notice that the path is the same as the path shown in B18 above. It would be great if that path would be dependent on the cell referenced above.
Thanks in advance!
Bookmarks