Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default using WScript.CreateObject("Wscript.Shell

Sub Test()
Dim objShell As Object
Set objShell = WScript.CreateObject("Wscript.Shell")
Wait = True
objShell.Run "c:\FSOTest\FTP02.BAT", 1, Wait
End sub

FTP02.BAT points to a script file that will "get" a file from an IBM
mainframe. (the FTP is tested and works as a stand-alone)

The "Set" statement gets a runtime error 424 "Object required"

I have added References for Microsoft VBScript Regular Expressions 1.0 and 5.5
pointing to C"\WINNT\System32\vbscript.dll\2 and ...\3 respectively (perhaps
there is a different reference that is needed?)

How do I make this code work from VBA?

I plan on making this run from an Open event to always refresh the data from
an external source before the spreadsheet data is shown.


--
Regards,
John
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 249
Default using WScript.CreateObject("Wscript.Shell

Change this line;
Set objShell = WScript.CreateObject("Wscript.Shell")
to
Set objShell = CreateObject("Wscript.Shell")


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect

"John Keith" wrote:
| Sub Test()
| Dim objShell As Object
| Set objShell = WScript.CreateObject("Wscript.Shell")
| Wait = True
| objShell.Run "c:\FSOTest\FTP02.BAT", 1, Wait
| End sub
|
| FTP02.BAT points to a script file that will "get" a file from an IBM
| mainframe. (the FTP is tested and works as a stand-alone)
|
| The "Set" statement gets a runtime error 424 "Object required"
|
| I have added References for Microsoft VBScript Regular Expressions 1.0 and
5.5
| pointing to C"\WINNT\System32\vbscript.dll\2 and ...\3 respectively
(perhaps
| there is a different reference that is needed?)
|
| How do I make this code work from VBA?
|
| I plan on making this run from an Open event to always refresh the data
from
| an external source before the spreadsheet data is shown.
|
|
| --
| Regards,
| John


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using WScript.CreateObject("Wscript.Shell


Hello John

you may try

Sub Test()
Dim objShell As Object
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "c:\FSOTest\FTP02.BAT", 1, True
End Sub


else you need the Windows Script Host Object Model reference

Sub Test2()
Dim objShell As WshShell
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "c:\FSOTest\FTP02.BAT", 1, True
End Sub


Regards ,
michel


--
michelxld
------------------------------------------------------------------------
michelxld's Profile: http://www.excelforum.com/member.php...o&userid=17367
View this thread: http://www.excelforum.com/showthread...hreadid=400515

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using WScript.CreateObject("Wscript.Shell


Hello Dave

sorry , i didn't see your anwser

regards ,
michel


--
michelxld
------------------------------------------------------------------------
michelxld's Profile: http://www.excelforum.com/member.php...o&userid=17367
View this thread: http://www.excelforum.com/showthread...hreadid=400515

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
Set OutApp = CreateObject("Outlook.Application") - Runtime error 429 Buffyslay Excel Programming 2 July 20th 05 05:06 PM
Excel:Runtime Error 7 "Not enough Memory" with CreateObject (SAP.B sebastienm Excel Programming 0 July 24th 04 08:35 AM
CreateObject("Excel.Application") - Access denied Luca[_2_] Excel Programming 0 February 6th 04 01:21 PM
Office 2003 not able to run wscript?? Gordon Cashmore[_2_] Excel Programming 2 December 19th 03 05:53 PM
WScript object not found (???) Tom Ogilvy Excel Programming 1 July 10th 03 10:59 PM


All times are GMT +1. The time now is 02:31 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"