Good Morning All,
I have a sendkeys project I am nearing completion, the only issue I have currently is I get stuck on a section of the application that requires you to hit the select button. I searched google but for the most part found no solid solution. Is it possible to include a Left Click to hit the select button on the application using SendKey VBA?
I have a sendkeys project I am nearing completion, the only issue I have currently is I get stuck on a section of the application that requires you to hit the select button. I searched google but for the most part found no solid solution. Is it possible to include a Left Click to hit the select button on the application using SendKey VBA?
Code:
Sub HazatTest()
'
' CompleteSTARandExcelSendKeyCode Macro
' Macro recorded 12/22/2010 by UMMS User
'
'
Dim EnterKey As String
Dim ThreeKey As String
Dim YesKey As String
Dim AccountKey As String
Dim rowkey As Integer
Dim Startkey As Integer
Dim CtrlKey As String
Dim HomeKey As String
Dim TimeKey As Date
Dim UpdateKey As String
Dim AltKey As String
Dim SaveKey As String
Dim XKey As String
Dim OpenKey As String
'-------------------
EnterKey = "~"
ThreeKey = "3"
YesKey = "Y"
CtrlKey = "^"
HomeKey = "{Home}"
Startkey = "8"
TimeKey = Now()
AltKey = "%"
SaveKey = "s"
XKey = "x"
OpenKey = "o"
rowkey = Range("B1")
AppActivate ("SendKey_HB_Testing.xlsm"), False
Application.Sheets("Accounts").Select
Range("D" & rowkey & ":D10000").Select
Selection.ClearContents
Range("F" & rowkey & ":F10000").Select
Selection.ClearContents
Range("G8:G10000").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("D" & rowkey).Select
AccountKey = Range("B" & rowkey)
UpdateKey = Range("G" & rowkey)
'================================================
'STAR Send Key Code
'================================================
UpdateKey = Range("G" & rowkey)
'Open the GL Remap
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys AltKey & "(f)", True
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys OpenKey, True
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys ("{TAB}"), True
'Update The Rule Name
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys ("^a"), True
'Update The Rule Name
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys ("{DEL}"), True
'Update The Rule Name
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys (UpdateKey), True
'Application.Wait (Now + TimeValue("00:00:01"))
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys ("{TAB}"), True
'Application.Wait (Now + TimeValue("00:00:01"))
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys ("{ENTER}"), True
'Save the GL Remap
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys AltKey & "(f)", True
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys SaveKey, True
'Close the GL Remap
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys AltKey & "(f)", True
AppActivate ("GL Account Remap"), False
Application.Wait (Now + TimeValue("00:00:01"))
Application.SendKeys XKey, True
'Notify the user the process is done.
AppActivate ("SendKey_HB_Testing.xlsm"), False
Application.Sheets("Accounts").Select
MsgBox "Done", vbOKOnly
Exit Sub
End Sub
Last edited: