I want to create a bat file on excel
Please clarify a little bit more which program you wish to do what.
- How is Access related to this question?
- How is Excel related to this question?
Just to make it more clear...
Regardless, in order to solve
any scenario where you need a program to initiate a procedure to copy that same program that can't be open while the code runs, you can always:
1) have your host program (whether Access or Excel), create a .vbs or .bat file
2) in the .vbs or .bat file, add a 5 second pause at the beginning
3) code your host program (whether Access or Excel) to: a) create the .vbs or .bat file, b) start it running, then c) close the host program
I would recommend vbs instead of bat, it is 1000x more control-of-flow friendly.