ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using a "SHELL" Command (https://www.excelbanter.com/excel-programming/396542-using-shell-command.html)

Mac Lingo[_2_]

Using a "SHELL" Command
 
I'm getting an error message that implies that I can't call a procedure on
my system:
"This error can also occur if an attempt is made to call a procedure that
isn't valid on the current platform."
I'm running VBA 2003.

And the procedure I'm trying to run is to invoke a batch file ith the line

TS = Shell(FileName & ".bat", vbMinimizedNoFocus)

Any idea why this isn't working???

Mac in Berkeley, CA



Tom Ogilvy

Using a "SHELL" Command
 
You need to supply the full path to the file?

--
Regards,
Tom Ogilvy


"Mac Lingo" wrote:

I'm getting an error message that implies that I can't call a procedure on
my system:
"This error can also occur if an attempt is made to call a procedure that
isn't valid on the current platform."
I'm running VBA 2003.

And the procedure I'm trying to run is to invoke a batch file ith the line

TS = Shell(FileName & ".bat", vbMinimizedNoFocus)

Any idea why this isn't working???

Mac in Berkeley, CA




Mac Lingo[_2_]

The Batch File being used.
 
Re Tom Olg's note, the file directory is specified.

But I thought it might be useful to show the batch file:

ftp -s:E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Echo "Complete" E:\Data - Mac\Mac's Documents\My
Stuff\Programs\Directory.out

And Directory.txt:
open FTP....
username
password
cd ...\Mac's\
binary
send E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Diretory.txt
bye





No Name

The Batch File being used.
 
Could it have anything to do with the typo in the 2nd to last line?

"Mac Lingo" wrote in message
t...
Re Tom Olg's note, the file directory is specified.

But I thought it might be useful to show the batch file:

ftp -s:E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Echo "Complete" E:\Data - Mac\Mac's Documents\My
Stuff\Programs\Directory.out

And Directory.txt:
open FTP....
username
password
cd ...\Mac's\
binary
send E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Diretory.txt
bye







Mac Lingo[_2_]

Last Line
 
The last line has been fixed as follows.

And Directory.txt:
open FTP....
username
password
cd ...\Mac's\
binary
send E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Diretory.txt
bye


to
send E:\Data - Mac\Mac's Documents\My Stuff\Programs\Directory.txt
Directory.txt

Doesn't fix it.



[email protected][_2_]

Using a "SHELL" Command
 
You ftp script is a joke.

Put the following in a file having a suffix .scr, for example,
example.scr.
Use forward slashes not backslashes
Use put not send
"lcd" means "local cd"
Use \ to escape blanks

user username password
bi
cd /Mac's
lcd E:/Data\ -\ Mac/Mac's\ Documents/My\ Stuff/Programs
put "Directory.txt"
quit

Get your ftp script running on the command line. After that change
your VBA to:

TS = Shell("ftp -s hostname example.scr", vbMinimizedNoFocus)


Mac Lingo[_2_]

Further reflections on the Problem
 
Can "SHELL" execute a Batch Command.

And once the command is executed, how do I get the results of running the
FTP command back to me?

Mac



No Name

Using a "SHELL" Command
 
The batch file DOES work if you double-click it right?


"Mac Lingo" wrote in message
...
I'm getting an error message that implies that I can't call a procedure on
my system:
"This error can also occur if an attempt is made to call a procedure that
isn't valid on the current platform."
I'm running VBA 2003.

And the procedure I'm trying to run is to invoke a batch file ith the line

TS = Shell(FileName & ".bat", vbMinimizedNoFocus)

Any idea why this isn't working???

Mac in Berkeley, CA




Mac Lingo[_2_]

What does "double clicking it right" mean?
 

<- wrote in message ...

The batch file DOES work if you double-click it right?




Craig Coope

What does "double clicking it right" mean?
 
On Fri, 31 Aug 2007 15:28:54 -0700, "Mac Lingo"
wrote:


<- wrote in message ...

The batch file DOES work if you double-click it right?



I assume it means "if you double click the mouse button properly" on
it.

--
The Zero ST

JE McGimpsey

What does "double clicking it right" mean?
 
I assume a comma is missing:

The batch file DOES work if you double-click it, right?


In article ,
"Mac Lingo" wrote:

<- wrote in message ...

The batch file DOES work if you double-click it right?



All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com