FTP in VBA via Shell with logging

tndinnc

New Member
Joined
Jan 8, 2013
Messages
3
I have the following code I am trying to execute. If I debug.print sCommand I can copy and paste it in a cmd window and it will execute. But it will not work in VBA unless I take out the >\\.....\log.txt portion. It's like trying to make a log file breaks it. Can someone help me figure out what i'm doing wrong here?
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile("\\server\folder1\folder2\folder3\ftpscript.txt", True)
a.writeline "test" 'username
a.writeline "test123" 'password
a.writeline "put " & Chr(34) & sfile & Chr(34)
a.writeline "quit"
a.Close
sCommand = "ftp -i -s:" & Chr(34) & "\\server\folder1\folder2\folder3\ftpscript.txt" & Chr(34) & " ftp.xsite.com > " & Chr(34) & "\\server\folder1\folder2\folder3\LOG.TXT" & Chr(34)
Shell sCommand, vbMaximizedFocus
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top