Public Declare Function SetForegroundWindow Lib "user32.dll" (ByVal hwnd As Long) As Long
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Sub Command1_Click()
row = 6
lpClassName$ = "#32770" 'Class ID for SAP Window
lpCaption$ = "Maintain Serial Numbers" 'Window Title of SAP Window
mHwnd = FindWindow(lpClassName$, lpCaption)
resAPI = SetForegroundWindow(mHwnd)
resAPI = SetForegroundWindow(mHwnd)
p = 0
Do While p < (3 * 4)
DoEvents
' p = p + 1
Loop
For i = 0 To 24
dispcol (i)
Next i
MsgBox("done")
End Sub
Private Sub dispcol(i As Integer)
r = 6
Dim tim
Dim tim1
mtxt = Trim(fg1.TextMatrix(r, i))
''SendKeys fron + CStr(count1), True
k = 0
Do While k < 1
DoEvents
Loop
SendKeys mtxt
k = 0
Do While k < 1
DoEvents
Loop
SendKeys "{Down}", True
resAPI = SetForegroundWindow(mHwnd)
resAPI = SetForegroundWindow(mHwnd)
End Sub
Also I did not get Why
k=0
Do While k<1
DoEvents
Loop
Since k will be 0 always how loop will get break There is Timer in Application is there any realtion with Timer.
Private Sub Timer1_Timer()
p = p + 1
If p > (3 * 4) Then
p = 0
End If
k = k + 1
If k > 1 Then
k = 0
End If
End Sub
Please tell me flow ....If you can. I'm not getting it I will be thatnk full ....
Pramodmca09, if this helps please login to Mark As Answer. | Alert Moderator