Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

'Executing' a string

Posted on 1998-07-25
2
Medium Priority
?
222 Views
Last Modified: 2010-05-03
Is it possible to save a VB command in a string and then call a function to execute it?  If so, how?
0
Comment
Question by:Egore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 8

Accepted Solution

by:
MikeP090797 earned 200 total points
ID: 1466665
There is no built in way to do it, but you can write a procedure(a pretty comlicated one) that will parse string commands, and turn then into VB code:

Sub Execute(Command as string, Args as string)
  Dim S1, S2 as string
 If Command = "Name" then
  S1 = Left(Args, instr(args, " "))
  S2 = Right(Args, len(args)-instr(args, " "))
  Name S1 as S2
 End if
 'And so on for every command you wish to implement
   
End Sub

0
 

Expert Comment

by:frankhommers
ID: 1466666
You could check out the new Microsoft Scripting Control, it's on the Microsoft site (www.microsoft.com).
It's very easy to implement VBScripting or JScript in your own program! CHECK IT OUT!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

721 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