Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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




  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 236
Default 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)

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default 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


  #8   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default What does "double clicking it right" mean?


<- wrote in message ...

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



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default 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


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default 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?

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
How to use the "shell" command? Tom Excel Discussion (Misc queries) 11 April 27th 10 12:52 AM
command button and the "enter" and "tab" keys dr chuck Excel Programming 10 September 11th 06 12:09 AM
inserting a conditional "go to" command on a excel "if" function velasques Excel Worksheet Functions 5 March 10th 06 08:16 PM
Problem using Excel's "Shell" command Jim Simpson Excel Programming 0 May 20th 04 06:28 PM
Is there a "replace" or "Substitute" command in Excel's VB? [email protected] Excel Programming 2 December 5th 03 07:56 AM


All times are GMT +1. The time now is 01:30 PM.

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

About Us

"It's about Microsoft Excel"