Heard of PsTools? U will luv it... it has many features that would help u in your case. here's a link to download it: http://www.sysinternals.com/file/pstools.zip
Have Fun!
...you can kill a program by using API functions or by using pskill from pstools.
to use API, by the way, you must know the classname and/or title of the program that you want to close...use spy.exe, if you want to get a class name of a program. run Calc.exe then try this:
option explicit...
...i have written a function that will return nth number of weekday sometimes ago. here it is:
Function NthWeekDate(NthDays As Integer, Optional tmpDate As Date = 0) As Date
Dim i As Integer
Dim n As Integer
Dim myDate As Date
Dim myWeekDay
If tmpDate = 0 Then...
...you can use the GetObject method like this:
Dim myAcc As Access.Application
Dim dbName As String
On Error Resume Next
dbName = "Test.mdb"
Set myAcc = GetObject(, "Access.Application")
Debug.Print myAcc.CurrentDb.Name
If...
...it can be done with several API function or just make it simplier, use AppActivate statement from within VB like this:
AppActivate "temp", 1
...Have Fun!
how do you populate the list view? is it with a recordset that has a flag of what was checked or not? let me know... 'cause i have done something like that but may be, we have to approach differently in your case.
Have Fun!
...try using Open statement to open the file as binary for read only access. and if you know the byte position of the value that you're looking for, then try using Seek function to help return the value faster... something like this:
Dim TextChar
Open "c:\temp\FILE.rpt" For...
...& strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("select * from win32_process where name = '" & strAppName & "'")
If colProcesses.Count > 0 Then
Debug.Print strAppName & " is running"
Else...
...sorry for the misunderstanding. try this:
Dim myXL As Excel.Application
Dim FileName As String
On Error Resume Next
FileName = "C:\Main2.xls"
Set myXL = GetObject(, "Excel.Application")
Debug.Print myXL.ActiveWorkbook.FullName...
Set MyXL = GetObject("C:\Main2.xls", "Excel.Application")
should be:
Set MyXL = GetObject("C:\Main2.xls", "Excel.Sheet")
by the way, if you just need to check for a specific file,
try this:
Dim myXL As Object
On Error Resume Next...
...why would we want to close it if it's already closed???
what i've tried is making sure the connection is closed before connection is open, but if it's already open then don't open it again... 'cause it may cause errors.
Have Fun!
...try checking for sckClosed instead:
If Winsock1.State <> sckClosed Then Winsock1.Close
Winsock1.RemoteHost = HostName
Winsock1.RemotePort = PortNumber
Winsock1.LocalPort = 0
Winsock1.Connect
End If
Have Fun!
sorry for this late response, i just got back from a vacation. anyway, i see what you tried to do. as i can recommand, don't use CDONTS for your VB app, 'cause it designed for the web on NT server. instead, try to use MAPI object. here's somecodes that you can try:
Dim objSession As Object...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.