vba 怎么结束运行中的进程

vba 怎么结束运行中的进程,第1张

------游卖虚---------------

Public x As String '申明一个神燃公共变量

Sub A()

End Sub

---------------------------------

Private Sub CommandButton1_Click()'  窗体1控件程序代码

'

'你的过程

'

Dim m%

UserForm2.Show

'

'

If x = "CommandButton2" Then

MsgBox x

Exit Sub

End If

If x = "CommandButton1" Then

MsgBox x

End If

'你的过程'

'

End Sub

----------------

Private Sub CommandButton1_Click()‘’窗体1控件代码

Unload Me

End Sub

Private Sub CommandButton2_Click()

Unload Me

End Sub

Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)

x = Me.ActiveControl.Name

End Sub

------------------配颤

on error GOTO A

A:msgbox()

在调用的帆帆穗前面on error GOTO A

在SUB结束前面

A:msgbox()‘提示

end'结束轿烂程序

end sub

==============态卜===

你直接吧A放到你程序的结束地方不就好了

For Each 氏则Process In GetObject("winmgmts:").ExecQuery("select * from 桥宴Win32_Process where name='EXCEL.EXE'"敏核银)

        Process.Terminate (0)

Next


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/yw/12393789.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-25
下一篇 2023-05-25

发表评论

登录后才能评论

评论列表(0条)

保存