ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó¥ÎVBAÃö³¬¥~³¡µ{¦¡

[µo°Ý] ¦p¦ó¥ÎVBAÃö³¬¥~³¡µ{¦¡

½Ð±Ð¤j¤j
¦p¦ó¥ÎVBAÃö³¬¥~³¡µ{¦¡

·Ð½Ð¤j¤j¨ó§U¸Ñµª,ÁÂÁÂ!!

¤U¦Cºô§}¦³»¡¤èªk,§Ú¶}±Ò¥~³¡³nÅé¨S°ÝÃD,¦ýÃö³¬¥~³¡³nÅé,¤@ª½¥Î¤£¥X¨Ó,½Ð±Ð¤j¤j¦p¦ó­×§ï

https://tw.answers.yahoo.com/question/index?qid=20070807000016KK08276

Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long

Public Const WM_CLOSE = &H10

2.¦bForm¤W©Ô¨â­Ó«öÁä¡A¨ÃCOPY¤U­±µ{¦¡
Private Sub Command1_Click()
Rem ¶}±Ò¤pºâ½L«ö¶s
Shell "C:\WINNT\system32\calc.exe" 'µ{¦¡ªº¸ô®|
End Sub
Private Sub Command2_Click()
Rem Ãö³¬¤pºâ½L«ö¶s
Dim winHwnd As Long
Dim RetVal As Long
winHwnd = FindWindow(vbNullString, "¤pºâ½L") '±ýÃö³¬ªºµ{¦¡ªº¦WºÙ
Debug.Print winHwnd
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
If RetVal = 0 Then
MsgBox "Error posting message."
End If
Else
MsgBox "¨Ã¥¼¶}±Ò¤pºâ½Lµ{¦¡."
End If
End Sub

TOP

¤U¦Cºô§}¦³»¡¤èªk,§Ú¶}±Ò¥~³¡³nÅé¨S°ÝÃD,¦ýÃö³¬¥~³¡³nÅé,¤@ª½¥Î¤£¥X¨Ó,½Ð±Ð¤j¤j¦p¦ó­×§ï

https://tw.ans ...
blue2263 µoªí©ó 2018-8-14 22:32



    ¬Ý¤£À´¹ê»Ú¥Î·N¡C
    ¦pªG¥u¬O³æ¯Â­n¹Bºâ¼Æ­È¡AEXCEL´N¥i¥H¡C

  ¦h°µ¦h·Q¦h¾Ç²ß¡A¤Ö¬Ý¤Ö¿ù¤Ö°g³~

  ¦h°µ=¦h¦h½m²ß¡A¦h¦h½s¼g¡C
  ¦h·Q=·Q·Q¬°¤°»ò¤H®aµ{¦¡­n¨º¼Ë¼g¡A¦pªG´«¦¨¦Û¤v¡A¤S·|«ç¼g¡C
  ¦h¾Ç²ß=¾Ç²ß¤H®aªºµo°Ý¨Ã¸Ñµª¡A¾Ç²ß¤H®aªº¼gªk

  ¤Ö¬Ý=¥u¬Ý¤£°µ¤]ªPµM

TOP

¦^´_ 3# mark15jill

M¤j±z¦n
§Ú¥­®É¦³¥ÎEXCEL­p°O¿ý,¬Ý½L³nÅ骺DDE°T®§,¦³®É¬Ý½L³nÅé·|¥X²{¿ù»~
§Ú·Q¥X²{¿ù»~®É,­«±Ò¬Ý½L³nÅé,©Ò¥H§Úªº­«ÂI¬O¦p¦óÃö³¬¥~³¡µ{¦¡,¤£¬OÃö³¬¤pºâ½L

ps:§Ú¬O·Q¤pºâ½L¥i¥HÃö³¬¦¨¥\,¨Ì²zÀ³¥Î¨ì¨ä¥¦³nÅéÀ³¸Ó¤]¥i¦æ
ps:§Ú·QÃö³¬­«±Òªºµ{¦¡¬O ±d©M.¥þ³£ÁȳnÅé

TOP

¥»©«³Ì«á¥Ñ quickfixer ©ó 2018-8-17 01:50 ½s¿è

¸Õ¬Ý¬Ý


Sub stopApp()
   
    Dim app As String
    Dim objWMI As Object, objProcess As Object, objList As Object
    Dim intError As Integer



    app = "calc.exe" '³o¸Ì¶ñ¤J­nÃö³¬ªº°õ¦æÀɦWºÙ


    Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
    Set objList = objWMI.ExecQuery("select * from win32_process where name='" & app & "'")
   
    For Each objProcess In objList
        intError = objProcess.Terminate
        If intError <> 0 Then Exit For
    Next

    Set objWMI = Nothing
    Set objList = Nothing
    Set objProcess = Nothing

End Sub

TOP

¦^´_ 5# quickfixer


    ·PÁÂQ¤j¨ó§U,¤v¸g¸Ñ¨M§Úªº°ÝÃD¤F,ÁÂÁÂ!!

TOP

        ÀR«ä¦Û¦b : °ß¨ä´L­«¦Û¤vªº¤H¡A¤~§ó«i©óÁY¤p¦Û¤v¡C
ªð¦^¦Cªí ¤W¤@¥DÃD