Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Executing an FTP call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mac Lingo - 29 Sep 2007 16:13 GMT
When I execute "Commands.Bat" (see below for content) in the CMD window,
the file "Commands.Out" is created in
               "E:\Data - Mac\Mac's Documents\Application Data\".

But when I execute it from the Shell Command in Excel with
               TS = Shell("Cmd /c Commands", vbNormalFocus)
the file "Commands.Out" is not created.
If I type "Cmd /c Commands" in the CMD window, it works.

Any ideas why this doesn't work in Excel?
Or is this just an error in my version of XP?
And if it is an error, how do I get around it?

tnx,
Mac

=============================================================================

Content of  "Commands.Bat"
   cd E:\Data - Mac\Mac's Documents\Application Data\
   ftp -s:Commands.txt > Commands.Out

Content of "E:\Data - Mac\Mac's Documents\Application Data\Commands.txt:"
   open FTP.Address
   ftp_UserName
   ftp_Password
   Dir
   bye
Leith Ross - 29 Sep 2007 17:47 GMT
> When I execute "Commands.Bat" (see below for content) in the CMD window,
> the file "Commands.Out" is created in
[quoted text clipped - 24 lines]
>     Dir
>     bye

Hello Mac,

When executing from VBA you need to change the current directory to E:
before executing the Shell statement...

    ChDir "E:"
    TS = Shell("Cmd /c Commands", vbNormalFocus)

Sincerely,
Leith Ross
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.