Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Executing an FTP call

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Executing an FTP call

On Sep 29, 8:13 am, "Mac Lingo" wrote:
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


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Executing a Value in a cell Tan Excel Programming 3 May 17th 06 03:46 AM
prevent UDF from executing masterphilch Excel Programming 4 January 13th 06 08:40 PM
executing an add in Gary Keramidas Excel Programming 6 November 6th 05 09:56 PM
VBA - Writing in XL XP, executing in XL 97 Paulo de Arruda Borelli[_2_] Excel Programming 2 August 17th 04 05:14 AM


All times are GMT +1. The time now is 11:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"