Solved

Redirection in Shell function

Posted on 2000-03-13
2
171 Views
Last Modified: 2010-05-02
I want to sort a text file from within Visual Basic. I tried:
x = Shell("sort filea > fileb"), but I get an error saying that the file ">" can't be found. Obviously it doesn't recognize the > as a redirection.
How can i accomplish the sort?
0
Comment
Question by:cbutton
2 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 100 total points
ID: 2614521
You'll need to lounch your Command interpreter, e.g.:
x = Shell("Command.com /c sort filea > fileb")
0
 

Author Comment

by:cbutton
ID: 2617714
I don't realy understand why, but that's okay. It works just fine.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Sending a email via excel using vba 6 80
Add a task in Outlook from access 11 39
Protecting vb6 & .Net code Obfuscation 18 121
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 51
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question