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

[µo°Ý] VBA °õ¦æERP§PÂ_°ÝÃD

[µo°Ý] VBA °õ¦æERP§PÂ_°ÝÃD




·Q½Ð±Ð¤@­ÓVBA°õ¦æERPªº°ÝÃD¡A¦ý¦]¬°¥u·|¨Ï¥Î§ì¨ú®y¼ÐÂI¿ï«ö¶s¤è¦¡°õ¦æ¡A©Ò¥H¥Ø«e¸I¨ì¤@­Ó°ÝÃD¡A´N¬O¦p¦ó§PÂ_ERP°õ¦æµe­±¬O§_¤w¶]§¹¡A¶i¦Ó¥i¥H°õ¦æ¤U¤@¨BÂI¿ï¤U¸ü«ö¶s¡C

¨Ò¦p¹Ï¤@¬O¨Ï¥Î®y¼ÐÂI¿ï¡iO.¦C¦L¡j«ö¶s«á¡A¥¦·|¶}©l°õ¦æ¨ÃÅã¥Ü¡u¹q¸£¥¿¦b§@·~¤¤¡A½Ðµy­Ô!¡v¡C¹Ï¤G«h¬Oµ{¦¡¤w°õ¦æ§¹¦¨¨ÃÅã¥Ü¤U¸ü¿ï¶µ¡iL.²×ºÝ¾÷¦Lªí¡j

·Q½T»{¬O§_¦³¿ìªk§PÂ_¡iL.²×ºÝ¾÷¦Lªí¡jµe­±¬O§_¤wÅã¥Ü¡A¦p¦¹¤~¯à¦AÄ~Äò°õ¦æ¤U¤@¬qVBAµ{§Ç¡C

§Ú¥Ø«e¬O¨Ï¥Î¥H¤UVBAµ¥­Ô®É¶¡°õ¦æ¤U¤@¬qµ{§Ç¡A¦ý¦¹§@ªk¸g±`¤Ó¦­©Î¤Ó¤[¤~°õ¦æ¾É­P¥¢±Ñ¡C

¥H¤W¨D¸Ñ~~~~~~

Sub ¤U¸üERP()
Dim RetVal
RetVal = Shell("Z:\AutoERP\AutoERP.exe", 3) '¶}±ÒERP

Application.Wait Now + TimeValue("0:01:30") 'µ¥­Ô1¤À30¬í
SetCursorPos 220, 160 '²¾¨ì®y¼Ð¦ì¸m
Application.Wait Now + TimeValue("0:00:1")
mouse_event &H2 Or &H4, 0, 0, 0, 0 'ÂI¿ï¡iL.²×ºÝ¾÷¦Lªí¡j«ö¶s

End Sub
*¦v¤k¤@ªTµL»~*

¥»©«³Ì«á¥Ñ jackyq ©ó 2022-9-6 16:05 ½s¿è

(1) AutoERP.exe ­pºâ§¹²¦«á , ·|¦Û¤vÃö³¬¦Û¤v¶Ü?
(2) excel is 32 or 64 bits ?

TOP

¦^´_ 2# jackyq


   ­pºâ§¹·|¦Û¤vÃö³¬¦Û¤v¨S¿ù~~~   32bits~~~
   ·PÁÂ~~~~~~~
*¦v¤k¤@ªTµL»~*

TOP

#If VBA7 Then
    Private Declare PtrSafe Function GetPixel Lib "gdi32" (ByVal hdc As LongPtr, ByVal x As Long, ByVal y As Long) As Long
    Private Declare PtrSafe Function GetCursorPos Lib "user32" (ByRef lpPoint As POINT) As LongPtr
    Private Declare PtrSafe Function GetWindowDC Lib "user32" (ByVal hwnd As LongPtr) As LongPtr
#Else
    Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
    Private Declare Function GetCursorPos Lib "user32" (ByRef lpPoint As POINT) As Long
    Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As Long) As Long
#End If
Private Type POINT
    x As Long
    y As Long
End Type

Sub Picture1_Click()
    Dim pLocation As POINT
    Dim lColour As Long

    Dim lDC As Variant
    lDC = GetWindowDC(0)
    Call GetCursorPos(pLocation)
    lColour = GetPixel(lDC, pLocation.x, pLocation.y)
    Range("a1").Interior.Color = lColour
End Sub
--------------------------------------------------------------------------------

¥H¤W¬Oºô¸ô¤j¯«À°¦£´£¨Ñªº·Æ¹«´å¼Ð§ì¦âµ{¦¡½X¡A¦ý§Ú¤£ª¾¹D­n«ç»ò§ï¦¨§PÂ_·Æ¹«´å¼Ð¦ì¸m¡A¦pªG§ì¨ì¤°»òÃC¦â®É¡A´N©¹¤U¤@¨B¶i¦æ¡A¤£ª¾¹D¦³¨S¤j¯«¥i¥HÀ°¦£§ï§ï©O
*¦v¤k¤@ªTµL»~*

TOP

see your message

TOP

        ÀR«ä¦Û¦b : ¨ü¤HÂI¤ô¤§®¦¡A¶··í´é¬u¥H³ø¡C
ªð¦^¦Cªí ¤W¤@¥DÃD