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:
sheets("b. Fill Out Required Info").Select
Actual Path found in B18:
C:UsersNickDesktopSubmission ToolTest Files
File attempting to execute:
I can manually put all of this together and get what I want by using:
Shell "C:UsersNickDesktopSubmission ToolTest FilesCopyFileNames.bat", 1
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:UsersNickDesktopSubmission
ToolTest 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:
cd C:UsersNickDesktopSubmission ToolTest Files dir /b/o |find
How can I put that cmd into VBA? I tried different versions of this with no success:
Shell "cmd.exe /c cd C:UsersNickDesktopSubmission ToolTest Files dir /b/o |find
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!