I need to transfer entire excel files (not just a range of data) from one directory to another using an Access Macro because I want to intersperse them with my other macros in Access. I want to run one macro that will call other macros. So I am thinking I need to figure out how to run DOS Batch files from Access and incorporate them in my Access dB. I think I have to use Shell / VBA.
If, for example, my batch file was Transfer01in.ba t, the code in Access might look like
call Shell ( Environ$ ( "COMSPEC" ) & " /c c:\Transfer01in .bat", vbNormalFocus)
And my batch file, Transfer01in.ba t, would contain
copy "C:\CD BI Model\2010 07\*.*" "C:\CD BI Model\Version E\*.*" /y
(Environ$("COMS PEC") returns the path to Command.com on the machine and the "/c" argument makes sure that the Dos window is automatically closed when the batch file finishes executing.
I need help to integrate it all into my Access database file.
If, for example, my batch file was Transfer01in.ba t, the code in Access might look like
call Shell ( Environ$ ( "COMSPEC" ) & " /c c:\Transfer01in .bat", vbNormalFocus)
And my batch file, Transfer01in.ba t, would contain
copy "C:\CD BI Model\2010 07\*.*" "C:\CD BI Model\Version E\*.*" /y
(Environ$("COMS PEC") returns the path to Command.com on the machine and the "/c" argument makes sure that the Dos window is automatically closed when the batch file finishes executing.
I need help to integrate it all into my Access database file.
Comment