• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Syntax Issues

Frank M

New Member
Appreciate what all of you have done in the past.
Keep up your excellent work.

My question. I'm trying to execute/run successfully the following statements in a Sub Module but can't seem to get the syntax requirements coded correctly. I've tried
different ideas from the Internet but without success.

Also would it be possible to check a return code after each statement is executed.

Thanks member Frank M

Sub X
C:
RD C:\"!!!Simple Treats Folder" /s /q
MD C:\"!!!Simple Treats Folder"
XCOPY E:\"!!!Simple Treats"\*.* C:\"!!!Simple Treats Folder" /E /V /Q /Y /H
End Sub
 
As your codelines are DOS command lines - so nothing to do with VBA ! - why don't you use a .bat or .cmd file ? …​
 
Back
Top