-
End process on error resume nextdim ss=""
set objwmiservice =getobject("winmgmts:!oot\cimv2")
set colprocesslist= _"select * from win32_process where name='" & s & "'")
for each objprocess in colprocesslist
msgbox "The target has been discovered! "
next
-
Seems to be a very professional question. 。I thought it was some kind of poison.
-
I haven't learned VB.,But there seems to be a command to end the excel process in other languages.,Write it after the release object.,The question mentions excel classification.,No one should answer your .......Adopt me.
-
It's pretty good, top it.
-
The two brothers upstairs were right.
1st Floor: API can interrupt the process of any program in memory.
2. Number: Use VB to call Excel objects to achieve control over Excel.
If you look at it from a coding point of view, I support the statement of the 2nd floor brother!
-
set xlsheet = nothingset xlbook = nothing
This section should have shut down the process.
-
I've also encountered this, and my solution is to kill the process.
private sub command1_click()kill ("")'Here's the call.
end sub
private sub kill(str as string)set objwmiservice = getobject("winmgmts:!oot\cimv2")
set colprocesslist = "select * from win32_process where name='" & str & "'")
for each objprocess in colprocesslist
End the process. next
set objprocess = nothingset colprocesslist = nothingset objwmiservice = nothingend sub
-
Method:1Double-click the icon in the upper left corner;
2.Documents – Exit;
3.Click the upper right corner to close;
4.Right-click on the taskbar to close;
f4;6.Task Management Ending a task;
7.Put end in the process.
-
Yes, sometimes it is difficult to exit with nothing when VB controls Excel, you need to exit by killing the process, and you can refer to the killing process.
-
Refer to macros in Excel and turn off macros.
-
I've come across it before.
Add this sentence at the end.
Hope it solves your problem.
-
Usually after you run out of objects, you should use the following three steps so that the process does not exist in memory.
excel = nothing
-
(true) 'Close the workbook and save the modificationsset objworkbook = nothingset objimportsheet1 = nothingset objexcelfile = nothing
-
Just use the opt-out procedure.
mid(string a, start looking for the bit value (data b), find the number of digits (data c)) Your function looks like this. >>>More
It can be done. You have to call the API to lock the excel object in the process. Then, you can directly obtain the process ID for listening and other operations. It's a bit difficult.
dim xlbook as 'Workbooks.
dim xlsheet as 'Worksheet. >>>More
1.This will be referenced in the Project References.
aaa as asdfg 'asdfg is the name of the class module. >>>More
Referencing the Microsoft Excel Type Library in the project: >>>More