By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,631 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,631 IT Pros & Developers. It's quick & easy.

passing a .vbs file in the command line

P: 6
In the command line to my executable I want to pass in a script file and then run that file at a specific point in my program. How do I call that file from within the program?
Apr 6 '07 #1
Share this Question
Share on Google+
7 Replies


SammyB
Expert 100+
P: 807
In the command line to my executable I want to pass in a script file and then run that file at a specific point in my program. How do I call that file from within the program?
Are you using VB6? VB.Net? VBA? The answer is different for each.
Do you need help getting the command line argument, or executing a file, or both?
Apr 6 '07 #2

P: 6
Sorry, it is a .bas file that I want to process. I am using Visual Basic 2005 Express.
Apr 6 '07 #3

P: 6
I just need help getting it to process (load and run), I can get the parameter via

System.Environment.GetCommandLineArgs()

I would like to load it into the program running to take advantage of an active OLE application object and document.
Apr 6 '07 #4

P: 6
I am fine converting the file to .vb so if there is a way to do it with that too please tell...
Apr 6 '07 #5

SammyB
Expert 100+
P: 807
I just need help getting it to process (load and run), I can get the parameter via

System.Environment.GetCommandLineArgs()

I would like to load it into the program running to take advantage of an active OLE application object and document.
So, you are running VB6? Sounds like you want to use GetObject to get the application, but we would need more information to answer how to pass the file to the app. What is the "OLE application object"? What do you mean by "document"? What are you passing to the app? etc.
Apr 6 '07 #6

P: 6
Turns out I can execute the macro using a method available from the application object. Thanks for the quick reply.
Apr 6 '07 #7

SammyB
Expert 100+
P: 807
Turns out I can execute the macro using a method available from the application object. Thanks for the quick reply.
You can also create a macro from scratch in your VB code, put it in your app, and execute it.
Apr 6 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.