Running Batch File from within Excel
On Mon, 16 Aug 2010 19:20:02 -0700, Mike S wrote:
Apologies, CurDir works in VB6 but not VBA I test this in an Excel 2000
macro and it worked, so I think this may work for you:
Public Sub doin()
Dim path As String
ChDir "C:\From G Data\Data Files & Test Programs\Work Data"
path = CurDir
MsgBox path
End Sub
ChDir "G:\From G Data\Data Files & Test Programs\Work Data\"
ExecCmd "zipbatch.bat", 15, True, ""
Sorry for not testing before posting, I need to remember that there are
some differences between VB6 and VBA.
Mike - thanks for your trouble. I did say you were dealing with a
novice, and, to be honest, simply not using ampersands in folder names
is a much simpler solution for me!
But I do appreciate your time. Thanks again.
Chris.
|