香港新浪網 MySinaBlog
Emily | 24th Jun 2007, 23:35 PM | WB & WS | (1698 Reads)

移動 Mouse 定位在 A8

'---------------------------------------------------------------------------------------
' Module    : Module1
' DateTime  :
' Author    : Colo
' Purpose   : Set Cursor Position
'---------------------------------------------------------------------------------------


Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long

Sub CursorPosition()
    Dim X As Long, Y As Long
    Dim Rg As Range
    Set Rg = Range("A8")
    X = ActiveWindow.PointsToScreenPixelsX((Rg.Left) * 96 / 72 * ActiveWindow.Zoom / 100)
    Y = ActiveWindow.PointsToScreenPixelsY((Rg.Top) * 96 / 72 * ActiveWindow.Zoom / 100)
    ' 72 (points per inch) is divided by a 96 (pixels per inch),
    ' then multiplied the percentage of the ActiveWindow.Zoom.
    ' Please note, a 96 /inch is a standard pixel resolution,
    ' so depending on the case, this coefficient must be changed to suit.

    SetCursorPos X, Y
End Sub

 (閱讀全文)

Emily | 21st Jun 2007, 08:19 AM | API / Add-in | (1269 Reads)

Automatic Mouse Movement

Worth to read this example:  Automatic Mouse Movement on UserForms

I have been using an Excel addin which I had need to automate some procedures overnight. There are a number a userforms which have certain commandbuttons to click. Unfortunately, you cannot access the Command Button click event from external code.
So I searched far and wide for a solution. I found the MouseMove API
routine and adapted it for VBA Userforms.

 


Emily | 10th Jun 2007, 11:31 AM | Office Application | (1640 Reads)

列出 Windows 更新歷史

VBAExpress KB List contents of the 'Windows Updates' history

如何得知套用 Windows Update 最後一個補充程式的時間?

http://www.microsoft.com/taiwan/technet/scriptcenter/resources/qanda/aug05/hey0824.mspx

 

 (閱讀全文)