|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
I am writing some code to do some alteration in a calculation input data and after finishing this, this code should call an external exe (calcu.exe) to do some calculation. There is no option to insert the calculation codes inside VB codes. I must call this external exe. May any one gudie me to write the code for calling the external exe from VB codes?
Thanks and regards. |
|
#2
|
|||
|
|||
|
Look in your VB help for the Shell function.
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
|||
|
|||
|
I studied the topic. Still it seems to be a little bit difficult as I am new to VB. Can anyone help me with an example code for this ( suppose I would like to run abc.exe by clicking a button "RUN" )? This would be very much helpful for me.
Thanks & regards. |
|
#4
|
|||
|
|||
|
If you get a good answer to this I would be greatful if you would send me a copy
gpsmaps@cdrive.co.za Thanks Glen |
|
#5
|
||||
|
||||
|
Example:
Code:
Option Explicit
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Private Sub cmdLaunchCalc_Click()
Dim result As Long
result = ShellExecute(Me.hwnd, "Open", "calc.exe", vbNullString, vbNullString, 0)
End Sub
|
|
#6
|
|||
|
|||
|
Dim strPathToProgram As String
strPathToProgram = Environ("windir") & "\System32\calc.exe" Shell ("" & strPathToProgram & "") |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Calling external Exe file from VB code |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|