Executing VBScript Functions
Is there a way to run a client side VBScript in Internet Explorer (or the WebBrowser control) from an external application?
Example: I have a Visual Basic form with a WebBrowser control on it. I want to be able to click a button on the form, and run one of the VBScripts contained in the loaded document.
Any help would be appreciated.
Thanks.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Executing Javascript/vbscript From VB
I want to execute a javascript written on a webpage through my VB program. The javascript uses the controls defined in the HTML page (i.e. document.form1.name). One way I found to do this is use scriptControl. Now, my problem is how do I pass the webpage controls (document.form1) to the scriptControl. I tried making a HTMLDocument object, set it to the webpage document and use AddObject method of the control but it gives an error saying that object doesn't support this property. I am pasting the code below. If anybody can help, pls respond asap.
the HTML is
<html>
<script language="javascript">
function abc()
{alert(document.form1.name); }
</script>
<body>
<form name="form1">
<input type="button" name="b1" value="click me" onclick="return abc()">
</form></body></html>
The VB code is
Private Sub Command1_Click()
Dim doc As HTMLDocument
Set doc = WebBrowser1.Document
ScriptControl1.AddObject "doc1", doc, False
ScriptControl1.ExecuteStatement "alert(doc1.forms(""form1"").name )"
End Sub
Private Sub Form_Load()
WebBrowser1.Navigate2 "C: est1.html"
End Sub
Archana
Executing A VBScript From VB And Speed
I am executing the script like this:
Dim wshShell
set wshShell = CreateObject("WScript.Shell")
wshShell.Run "wscript tmp001.vbs", 0, true
This will run the script and wait until finished before continuing.
The script file looks like this:
Dim objFS
Dim objFile
Dim objTS
If ( true OR false) AND ( false OR false OR false) AND ( false OR false) AND ( true) then
set objFS = CreateObject("Scripting.FileSystemObject")
set objFile = objFS.GetFile("c: empoutput.txt")
set objTS = objFile.OpenAsTextStream(2)
objTS.WriteLine ("1")
objTS.Close
set objFS = nothing
else
set objFS = CreateObject("Scripting.FileSystemObject")
set objFile = objFS.GetFile("c: empoutput.txt")
set objTS = objFile.OpenAsTextStream(2)
objTS.WriteLine ("0")
objTS.Close
set objFS = nothing
End If
Is there anyway I can clean this up to make it run a bit faster for now?
-K
Permission Denied In VbScript Executing A SP
I have a vbscript that's parsing the XML document into a string variable called XMLfile. Needless to say this variable's value is quite large. I'm trying to invoke a SP using isql command line. This SP takes the variable as a parameter. WHen I invoke the SP within the Query Analyzer it works, but here in the VBscript I get a "Permission Denied". If I take out the '" & XMLfile & "' in the code below the SP runs. (of course it logs the error in log1.txt that SP XMLImport requires a parameter)
Is there some restriction to the "length" the command can be in the Run command? It's weird that it works without the parameter... I've written many VBScripts that do the same thing and all of them work. This is the first time I've hit this issue...and first thought is that my cmd is too long.....
Code:
cmd = "isql -S HYPERION -d XML -U web -P web -q ""exec XMLImport '" & XMLfile & "'"" -o \jepetersjoyxmllog1.txt "
'Create the object
Set WshShell = WScript.CreateObject("WScript.Shell")
' Run the SQL Script
'Call the isql to insert the data
ReturnCode = WshShell.Run(cmd, 1, True)
Any help would be appreciated
VBScript: Waiting For An Instruction To End Before Executing The Next One
I am writing a vbscript which installs several network printers in a given order. Example:
---
strRunCmd = "cmd /c rundll32 printui.dll,PrintUIEntry /in /n\servernameprinter1/q"
wshShell.Run(strRunCmd),showHidden,bWait
strRunCmd = "cmd /c rundll32 printui.dll,PrintUIEntry /in /n\servernameprinter2/q"
wshShell.Run(strRunCmd),showHidden,bWait
---
I want printer1 to be the default printer for the user UNLESS the user already has a printer installed when he runs the script: thus I avoided to use the SetDefaultPrinter method, and I chose to rely on the order the printers are installed.
I have noticed that if the user has no printer installed, sometimes he ends up with printer2 set as default, even though printer1 was supposedly installed before printer2 and should therefore be set as default.
I think this is because even though the printer1 install procedure was STARTED before printer2's, for some reason it ENDED after printer2's, resulting in printer2 being the default printer.
Is there a way to block the execution of the code until printer1 has FINISHED installing?
For now, I am experimenting with Wscript.Sleep (put before printer2's install routine) but it's a rather "dirty" solution.
Executing A Query Inside A Database In VBScript In Asp....
Ok... here is the code I wrote for the page and the database. I want the query "High" to run in this database but I don't know how. Below is the asp and the database being used, so I'd be greatful if anyone could change the code to work or give me the code in a reply, either way I'd be greatful if it worked.
Thanks in advance.
Executing A Vbscript From A Command Button In Access
couldn't decide where to post this one, but i have a vbscript that i am trying to execute from a command button in access 2000. the help says that i am supposed to execute "functions" through a macro. this means that in addition to writing the script, i have to compile a macro also. does anyone have a way of making the script run without the macro?
Connecting And Executing A Stored Procedure In SQL Server Through A VBScript.
Hi all,
I am trying to send data parameters of data that I am reading in from an
IStream to a sproc (stored procedure) within an SQL Server. The code I have
for the connection is as follows:
Set db = New ADODB.Connection
Set rs_PolMsg = New ADODB.Recordset
strConn"Provider=SQLOLEDB;Server=FAIRISAAC;Database =FI_HOST_DATABASE;UserID=sa;Pass
word=;"
db.ConnectionString = strConn
db.CommandTimeout = 30
db.CursorLocation = adUseClient
db.Open strConn
strConn = "sp_add_pa_policy_msgs '12082003','oRecord.PolNum', 'PA', '1',
'RHC-I-E.08', 'Review-Underwriter', 'Test for populating database fields'"
Set rs_PolMsg = db.Execute(strConn)
rs_PolMsg.Close
db.Close
The runtime-error I am receiving when I attemp to run the script is:
"Invalid connection string attribute", which debugs on the line db.Open
strConn.
Any help on this would be very much appreciated. Thanks in advance.
Kevin Baker
Applications Developer
Mutual Of Enumclaw Ins. Co.
email@removed
(360)825-2591 x3471
On Error Functions Always Executing
I have a a sub routine that unchecks some boxes, but I want to display a message if there is an error thrown up, which works. But the problem is, the message is displayed even if there is no error. Is there anyway around this?
Code:
Private Sub GoCmd_Click()
On Error GoTo ErrFunc
RadioC30.Value = False
RadioC32.Value = False
RadioC34.Value = False
RadioC36.Value = False
RadioC38.Value = False
RadioC310.Value = False
ErrFunc:
Message = MsgBox("Please select a value for all categories", vbOKOnly, "Invalid Selection ...")
Exit Sub
End Sub
Executing VB Functions From A Command Line?
I have several friends that program using scripting languages like Perl, Expect and Tcl. They would like to like to use some of my VB code functions in their application, but I have not found a way to allow them to execute these functions from a command line. Does anyone have a good method of acheiving this?
Thanks in advance.
One test is worth a thousand expert opinions.
Help On Executing JScript Functions Using Webbrowser Or Inet
Hello,
Can anyone help me to figure out the code to execute a JavaScript function in a webbrowser or INET document?
I want to execute a function called "check_all(1)" in an HTML page from a VB6 application using WebBrowser (SHDOCVW.DLL) or INET (MSINET.OCX) using the "document" attribute (if its possible).
First, I go "WebBrowser.Navigate("http://www.mysite.org"), then I want to execute a function called: "check_all(1)" by pressing a button in my app.
Can anyone help me?
SL64
Calling Functions From One Vbscript From Another
I don't know much about the VB Scripting. ( though I have done
Script-ing for DHTML in html pages).
In browser-pages we would be able to source any number of scripts as
<html>
<head> <!-- Start of HEAD -->
<script language=vbscript src=sample1.vbs />
<script language=vbscript src=sample2.vbs />
<script language=vbscript>
// make use of functions available in sample1.vbs and sample2.vbs
</script>
</head><!-- End of HEAD -->
<body>
</body>
</html>
Question:
Is there any similar way to source on VBScript inside another ?
Functions To Calculate Daylight Savings Time In VBScript
I had trouble finding these on the web so I wrote my own. Hope they are useful to someone.
Calculates Daylight Savings Time and European Union Summer Time
'The VB constants for the day of the week
SUNDAY = 1
MONDAY = 2
TUESDAY =3
WEDNESDAY = 4
THURSDAY = 5
FRIDAY = 6
SATURDAY =7
'************************************************
' American Daylight Saving time
'************************************************
Function GetDSTAdjustment (varDate)
If (IsDate(varDate)) then
If IsDST(varDate) then
GetDSTAdjustment = 1
else
GetDSTAdjustment = 0
End If
else
Err.Raise 55007, "Invalid parameter passed to GetDSTAdjustment"
End If
End Function
Function IsDST (varDate)
If (IsDate(varDate)) then
'Make sure its a date
varDate = Cdate(varDate)
intMonth = CInt(DatePart("m", varDate))
intYear = CInt(DatePart("yyyy", varDate))
If (intMonth > 4 And intMonth < 10) then
IsDST = true
ElseIf (intMonth < 4 And intMonth > 10) then
IsDST = false
else
If (varDate > GetDSTStartDate(intYear) AND varDate < GetDSTEndDate(intYear)) then
IsDST = true
else
IsDST = false
End If
End If
else
Err.Raise 55001, "Invalid parameter passed to IsDST"
End If
End Function
Function GetDSTStartDate (intYear)
' First Sunday of April
If (intYear > 1899 And intYear < 3000) then
'arbitrary limit for year value
GetDSTStartDate = DateAdd("h",2,FindFirstWeekdayXofMonth(SUNDAY,4,intYear))
else
Err.Raise 55002, "Invalid parameter passed to GetDSTStartDate"
End If
End Function
Function GetDSTEndDate (intYear)
' Last Sunday of October
If (intYear > 1899 And intYear < 3000) then
'arbitrary limit for year value
GetDSTEndDate=DateAdd("h",2,DateAdd("d",-7,FindFirstWeekdayXofMonth(SUNDAY,11,intYear)))
else
Err.Raise 55003, "Invalid parameter passed to GetDSTEndDate"
End If
End Function
'***********************************************
'************************************************
' European Union Daylight Saving time
'************************************************
Function GetEUDSTStartDate (intYear)
'last Sunday in March
If (intYear > 1899 And intYear < 3000) then
'arbitrary limit for year value
GetEUDSTStartDate=DateAdd("h",1,DateAdd("d",-7,FindFirstWeekdayXofMonth(SUNDAY,4,intYear)))
else
Err.Raise 55004, "Invalid parameter passed to GetEUDSTStartDate"
End If
End Function
Function GetEUDSTEndDate (intYear)
'last Sunday in October
If (intYear > 1899 And intYear < 3000) then
GetEUDSTEndDate = DateAdd("h",1,DateAdd("d",-7,FindFirstWeekdayXofMonth(SUNDAY,11,intYear)))
else
Err.Raise 55005, "Invalid parameter passed to GetEUDSTEndDate"
End If
End Function
Function IsEUDST (varDate)
If (IsDate(varDate)) then
'Make sure its a date
varDate = Cdate(varDate)
intMonth = CInt(DatePart("m", varDate))
intYear = CInt(DatePart("yyyy", varDate))
If (intMonth > 3 And intMonth < 10) then
IsDST = true
ElseIf (intMonth < 3 And intMonth > 10) then
IsDST = false
else
If (varDate > GetEUDSTStartDate(intYear) AND varDate < GetEUDSTEndDate(intYear)) then
IsEUDST = true
else
IsEUDST = false
End If
End If
else
Err.Raise 55006, "Invalid parameter passed to IsEUDST"
End If
End Function
Function FindFirstWeekdayXofMonth(intWeekdayConstant, intMonth, intYear)
If (intMonth>0 And intMonth<13) then
'valid month
If (intYear > 1899 And intYear < 3000) then
'arbitrary limit for year value
varDate = CDate(intMonth & "/1/" & intYear)
Do Until (DatePart("w",varDate) = SUNDAY)
varDate=DateAdd("d",1,varDate)
Loop
FindFirstWeekdayXofMonth = varDate
End If
else
Err.Raise 55000, "Invalid parameter in call to FindFirstWeekdayXofMonth"
End If
End Function
Javascript Functions > VB Functions
I've been trying to put together a vb form that has JS Xor Encryption abilities. I cant seem to get it to happen. I"ve tried various Xor encryption methods in vb, but they dont work the way I want.
here's what Im having a problem with:
I have a js encryption tool on my site that uses JS Xor encryption:
http://jmcivor.com/encryption
the page you'll find there uses the following functions:
Code:
<SCRIPT language=JavaScript type=text/javascript>
function xor_str()
{
var to_enc = document.forms['the_form'].elements["str"].value;
var xor_key=document.forms['the_form'].elements.xor_key.value
var the_res="";//the result will be here
for(i=0;i<to_enc.length;++i)
{
the_res+=String.fromCharCode(xor_key^to_enc.charCodeAt(i));
}
document.forms['the_form'].elements.res.value=the_res;
}
function decrypt_str()
{
var to_dec=document.forms['the_form'].elements.res.value
document.forms['the_form'].elements.dec_res.value="";
var xor_key=document.forms['the_form'].elements.xor_key.value
for(i=0;i<to_dec.length;i++)
{
document.forms['the_form'].elements.dec_res.value+=String.fromCharCode(xor_key^to_dec.charCodeAt(i));
}
}
//-->
</SCRIPT>
I've tried for a few days now to convert this to VB, I am SOOOO far beyond stumped, so I found the biggest baddest most active VB forum in hopes to get an objective view from somebody.
Basically, i want to rewrite that encryption page off my site into a complete vb form.
My reasoning?
Javascript in an HTML document has the crunching power of a one legged kitten. Yes yes, I know, VB isnt a super duper number pwnerer either by any standard, but it will indeed do it lightyears faster than JS in HTML.
PLEASE HELP!
Calling Functions From Other Functions
Hi people! I'm a newbie here and also a newbie in VB. I manage ASP/HTML but now I need to create a DLL to protect my functions. Everything is working... in some way(heh!), but I got stuck when calling a function from another function, here's the code:
VB Code:
'--------------------------------------------------------------------------------------------' Función para verificar que las bases de datos no hayan sido modificadas a mano ...'--------------------------------------------------------------------------------------------Function VerificarIntegridad() flag = "ORIGINAL" If ContarRegistros("pacientes", "", "") > AveriguarLimites("pacientes") Then flag = "MODIFICADO" If ContarRegistros("sucursales", "", "") > AveriguarLimites("sucursales") Then flag = "MODIFICADO" If ContarRegistros("logins", "categoria", "PROFESIONAL") > AveriguarLimites("profesionales") Then flag = "MODIFICADO" If ContarRegistros("logins", "categoria", "PERSONAL") > AveriguarLimites("personal") Then flag = "MODIFICADO" If flag = "MODIFICADO" Then Call AnularProgramaEnd Function
I'm calling two different functions from inside this function, the three functions works fine as they were tested in ASP. The fact is that when I compile the DLL and register it, when calling it from ASP, I get this error:
Error Type:
SistemaOdontologico (0x800A01A8)
Object required
/prueba.asp, line 5
I call the DLL in this manner:
VB Code:
Set SistemaOdontologico = Server.CreateObject("SistemaOdontologico.funciones")Call SistemaOdontologico.VerificarIntegridad
Anyone PLEASE can help me? maybe it's a silly thing, but as I said, I'm new to VB. Thanks a lot!!!
Functions In Functions?, Or Else Something Similar?
is it possible to do something equivalent to putting a function in a function, or else a sub in a function.
Essentially what i am doing is attempting to create a function that i can copy and paste into other projects, however some of the code inside the function is repeated several times (this makes me angry), so I want to be able to use a function to accomplish this task.
Unfortunatley, it is a performance based function, so i dont want to create a companion function as it is editing a large array(as much as 10,000,000 elements), and passing the array back and forth would (i assume) slow the program down somewhat. I want to declare the array inside the function, meaning it cant be just edited by an outside sub.
so would their be any way of accomplishing this through the equivalent of a nested function?
Executing *.chm
hi guys! i have a*.chm in my prog and i want to execute that file, but the problem is i dont know what program should i use to shell this file! can you please help me! thanks in advance!
Executing
is it possible to execute a program and have that trigger the execution of my program? basically i only want my prog to run when say "notepad.exe" is open. so if i execute notepad it will open my prog too?
Executing Vbs
how to execute a vbs file using vb program ?
the shell command doesn't work
SQL Not Executing
I have to following code:
Set MyConn = New ADODB.Connection
MyConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "ROMaster.MDB;"
MyConn.Open
SQLstr = "INSERT INTO SFTable (Invoice) VALUES ('1234')"
MyConn.Execute SQLstr
No record gets inserted, and no error is declared. What's wrong?
Executing Something
ok in vb i made a button what i want it to do when i click it is call on a program what code do i need i want it to call on this "C:Program FilesAIMaim.exe"
thanks
Executing A VB App From A Vb App
Hail all!
For example:
--> I have 2 exe files... They are A.EXE and B.EXE.
THE A.EXE have a buttom on it. If I click in this buttom, then it will execute the B.EXE file. The both files were made by me in vb6.
What should I do to make the example above works?
Thx for the help!
Elminster
Executing A SQL DTS From Within VB
I've tried two of the recommended methods of executing a DTS
one using the .dts package saved from SQL, calling this package from VB and
one using a .BAS module and executing this from within SQL.
Both methods work on my machine (win2k, office2k, SQL2000 pers ed) but when I create the setup programme and run on a second machine (win2k, office2k and can 'see' the sql server) it falls over when trying to create the DTS.Package - Unable to create object.
Am i missing a DLL or something (have included the dtspump.dll)?
any ideas would be appreciated
m
Mark Saunders
Self Executing
Is it possible to write a program in visual basic that will execute itself based on time of day. I know on a server it is possible to set runtime and then have the program resubmit itself until the desired task is done, is that possible to do with visual basic on windows?
Executing F.exe
I just have a problem .... looking for your support. Here it goes
I have a command button on a form. This button calls an executable file using shell command.... I made this simple project as executable file. When i put this executable vb file and the original executable in the same folder, the command button works perfectly. However, when i put the vb executable in the desktop... it doesn't call the original executable...... how can i call that executable from any folder of the vb executable? How the application path of vb and the executable going to be called related?
Executing A DLL
How would I execute a DLL file from a VB program ?
Is it possible to work out what gets passed to the DLL?
Thanks
Executing .reg Problems
I'm creating a program which executes a registeryfile (.reg), but I'd like the program to launch it and automatically install the registeries (so you don't have to click yes when it askes you if you want to install it) and after this, the program has to know the registering is finished and that it can continue.
Could anyone help me (if you have source codes, please post them)
NovA
Executing App Across Network
howdy. i have an exe on my main computer i want my two other pc's to be able to execute.
how can i do this across my network. should i have some server/client deal that sends a command to execute it that way.. or is there some easier way
thanks!
--val
Executing A Whois With A VB App
Can anyone tell me where to get started? I have no idea what I should do to "Whois" an IP within a VB6 app and get the results. Thanks!
Executing A Program...
I guess this would be the best place to put this question since it's for a game. Can I make a program that will open the second the user opens the disk? I want to make it so that my game is played on a floppy disk, and when they open it, the game will start, instead of a folder. Is this at all possible with VB? Trust me, I would try coding something like this before hand, but I'm completely in the dark about this. Thanks
Steps Executing Before They Should
I have a form, let call it Form1. When the user clicks a button (Button1) Form1, another form (Form2) opens and the user has to do some things on Form2 and then click 'OK'. Form2 then closes and returns to Form1. Then problem is this. On Form1, I have the event
Code:
Private Sub Button1_Click
Load Form2
Form2.Show
DoEvents
' Do the next steps after Form2 closes and returns here.
End Sub
I though the DoEvents would allow the user to finish everything on Form2, AND Form2 would unload, before executing the steps after the DoEvents. It actually opens Form2 and executes the next steps while Form2 is still open.
Is there any easy way to make the steps that follow only execute after Form2 closes?
Thanks,
Joe
Executing Code
Is there a way I can execute user-defined code?
I want to allow users to set vb code to FKeys in my irc client, I know how to store the data that they set for each key, but I don't know how to execute it.
For example:
If they set the F1 command as "msgbox("test")" then msgbox("test") would be executed.
Progress While Executing SQL SP
I have an MDI with a progress bar. If processing records for a report in the VB app I have no problem showing progress. However, more complex reports are done in SQL stored procs, and as a consequence I can not determine progress.
I have added a timer to the MDI, which is enabled (interval = 1000) just before the call to the SP. The timer event code is as follows:
Code:
DoEvents
If iProgressCounter = 5 Then
lProgressValue = lProgressValue / 2
If lProgressValue = 0 Then
lProgressValue = 1
End If
iProgressCounter = 0
End If
If MDI_Excel.pBar1.Value + lProgressValue < lProgressMax Then
MDI_Excel.pBar1.Value = MDI_Excel.pBar1.Value + lProgressValue
iProgressCounter = iProgressCounter + 1
Else
MDI_Excel.timProgress.Enabled = False
End If
The timer event works if I put it in Form_Load (for testing) but not where I need it - during execution of the SP.
Does anyone have any ideas why? Or is there an alternative approach to indicating (imitating) progress of a remote process?
Executing A 'variable'
I wrote a small program which will execute certain events when certain conditions have been met. One of them includes notifying another application using COM. I want to allow the user to specify which COM command to use by typing it in, and when it's triggered, have my VB app 'execute' this command. Is this possible at all?
Executing A Command In XP
Hi
I have the following peice of code
Set ExecuteReturnRecordset = mlobjcommand.Execute(, , varExecuteOptions)
This is executing a command and returning a recordset. This works fine when running on NT4 or Windows 2000. But when I run the same code on Windows XP i get the following error message. "Error -2147467259 Syntax or access violation". Does anyone have any ideas why this might be happening.
Thanks
Paul
Module Executing Twice
I have a problem. I have a Web based system with ASP and VB. One of my pages calls a VB module to insert a row into an oracle database. It inserts the record fie, but when if goes to run the class_terminate procedure which only closes the connection, it then goes and runs again the same procedure to insert the row in the database. It jumps from the class_terminate directly to the same procedure. I have tested this to find out where or how this might be occurring. Any sugestions on where to look and what to do here would be most appreciated. Thank you for any assistance anyone can provide. Please feel fre to e-mail me at william.kochevar@antaressolutions if you have any suggestions or just reply here. Thank you.
Executing Programs Such As...
Hi,
Here is a VBnewbie talking who has a hunger for information.
I want to execute programs such as word files or Torrents links or any extension.
Is there a command or API that can handle such an action.
My goal is to manage Torrent-downloads (for more info --> http://www.suprnova.org) on a random PC. So you can make a list of torrent-downloads and execute those files (and hoping that there is a function like Open With.... ) and also, if nescasarry, punch the location where the file(s) must be saved. Plus I want to view the size of the file.
Once again this is a VBnewbie asking for info.
Aight,
Thnx in advance,
Executing Variables ?
Does anyone know how to execute a varaible ?
i.e if you set a variable to the name of a function in your project, is it then possible to execute that variable and thus call that function ??
Cheers
Executing An Exe File
hi,
is there any way to execute executable files thru VB which are generally run by going to the DOS prompt. i want to know if i can write some code in order to execute the import and export utilty programs which oracle has. generally it is run by typing "exp" or "imp" at the command prompt. and if we can , then how do we provide the parameters to those commands.
thanks.
Executing Dos Command
Hai friends,
I have a command button in VB. On the click event of that button I want to execute a DOS command (type rep.txt >> prn).
Any one plz help me in this coding.
Thanx in advance.
Executing SQL Statements
hmm...
i have been using some online tutorials to learn how to use SQL Statements, but i cant seem to get them to work
i tried this:
newquery = "INSERT INTO PlayerProfiles (Name, DOB, Team, Speciality, Hand, AdditionalInformation) VALUES (playerprofiledetails.name, playerprofiledetails.date, playerprofiledetails.team, playerprofiledetails.speciality, playerprofiledetails.hand, playerprofiledetails.additionalinformation)"
DB.Execute newquery
where db is my database, playerprofiles is my tablename (which i have also declared as a recordset)
but get the error: "Too few parameters. Expected 6."
How To Know When Something Stops Executing
Howdy,
I am executing another program from my VB program using
Code:
x = Shell("C:Binwptorder.exe")
SendKeys "%(P)", True
What I want to do is wait until this program is closed and then resume my VB application. What actually happens is, "C:Binwptorder.exe" is an application. In this application, when you press Alt + P, another program starts. I want to wait until this second program is not executing anymore to get back to my application. I need help in accomplishing this. Thanks in advance.
Executing A Resource (.res)
Hello
I got a little question.
Is it possible to execute a resource (.exe) from inside my app, or do i have to drop it to a folder then execute ?
thanks for helping
Visual
Error Executing Sub...
Hi!
I have inserted the following sub in a module and calling the sub through a form but i get a error which i am unable to understand:
Code:
Public Sub LoadCode(FormName As Form, ComboName As ComboBox, TableName As String)
Dim DB As Database
Dim RS As Recordset
Dim WS As Workspace
Dim Max As Long
Dim I
Set WS = DBEngine.Workspaces(0)
Set DB = WS.OpenDatabase(App.Path & "Excise.Mdb")
Set RS = DB.OpenRecordset(TableName, dbOpenTable)
Max = RS.RecordCount
If RS.RecordCount >= 1 Then RS.MoveFirst
For I = 1 To Max
'Getting error at line below!
FormName.ComboBox.AddItem RS("Code")
RS.MoveNext
Next I
WS.Close
Set RS = Nothing
Set DB = Nothing
End Sub
'Runtime error: 438
'Error: Object does'nt support this property or method
I am calling it through a form named Form1 and the combo box name is: Combo1 so the params i am sending is:
Code:
Private Sub Form_Load()
LoadCode Form1, Combo1, "Item"
End Sub
How to fix the problem ?
Thanks!
HTML Executing An Exe
I have a VB program (typical .exe) located on a network drive that is several layers deep. I was wondering if someone knew how I could make this exe more accessible. Is there a way to have an inhouse website that initiates the exe file? If so what command would that be and could I make it so that the second the website is opened it automatically launches my program, or would I have to have the user click on a .exe link to initiate it?
Any advice (hopefully with coding examples since I am not too familar with HTML) would be great.
Thanks
HELP!! Executing Code On Run
Hi
Does anyone know how to cause a program to execute on running the exe. Because i want to have a hidden form and as it is run this code:
Private Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub EjectBtn_Click()
mciSendString "set CDAudio door open", t, 127, 0
mciSendString "set CDAudio door closed", t, 127, 0
End Sub
It will run the code on a loop delay of 60 seconds but i don't want to have to press anything. I just want it to start running.
How can I do this. I know it has got to be something with
Private Sub EjectBtn_Click()
Can anyone please help urgently
Executing A String
Hi! This is a little funny one:
How can I execute a string? I have an already compiled program in a string loaded. The easiest way is to write it to disc and start the app. But I dont want to do that. Actually I can't. (Dont have the permission.)
So is there a way to execute a string? Thanks: NetGod [from Hungary]
|