|
-
Mar 9th, 2004, 09:26 AM
#1
Thread Starter
New Member
Excel and DOS batch files
Hi All,
Head hurts with VB stuff so I thought I would ask all you nice bods
Is it possible using VB to add a DOS batch file into an Excel macro? Basically am trying to make job easier to spend more time surfin net
Any help muchly appreciated
Emu
I am always in the s**t its just the depth that varies
-
Mar 9th, 2004, 02:12 PM
#2
Did you try to "shell" it?
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Mar 10th, 2004, 03:08 AM
#3
Thread Starter
New Member
no as we can't work out? If i can find out will a shell do it?
I am always in the s**t its just the depth that varies
-
Mar 13th, 2004, 10:39 AM
#4
Junior Member
Here is an example of Shell in a Sub-procedure named ShellFromMe(), which should run C:\Autoexec.bat when you include the following line:
Call ShellFromMe
Public Sub ShellFromMe()
On Error Goto ErrorHandlerShell ' trap Shell errors
Shell "C:\Autoexec.bat", vbNormalFocus
Exit Sub ' immediately exits this Sub procedure
ErrorHandlerShell:
Msg = "Unable to run Autoexec.bat, the Batch file."
MsgBox Msg, vbExclamation + vbOKOnly, Me.Name
Resume Next ' resume at the next statement (Exit Sub)
End Sub
It is possible for your network administrator to prevent Shell running MS-DOS Batch script.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|