1

In my excel VBA code I'm automating the process of running a script ("PULLSCRIPT", which is also created in the code) that runs ftp, opens my FTP address, enters my user and password, pulls a file using mget, and lastly moves that file to another folder using Name. It works in Excel VBA (I click a macro and it does all these steps, no manual input required), but when I copy and paste it to PowerPoint VBA, the line

Shell ("ftp -s:" & sWorkingDirectory & FTP_BATCH_FILE_NAME)

doesn't run. It doesn't give me an error and, F8 stepping through it, it looks like the shell opens (just like when I step through it in Excel), but it never runs PULLSCRIPT (or if it does then it's not working). When I manually open cmd and run the PULLSCRIPT it works, but the point of automating it was so people wouldn't have to do that.

0

1 Answer 1

1

To debug the command execution, add cmd /k in front of it:

Shell ("cmd /k ftp -s:" & ...)

This way, the console window stays open and you can see, what went wrong.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks it worked! Somehow, the Shell command was running PULLSCRIPT in another directory, so I added ChDir "C:\correct path" and it works!!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.