August 8, 2020
I have a Macro that reads times entered on an excel sheet and opens another application that inputs delay time(downtime). After the downtime has been entered, the macro should enter done on each line after completing the loop.. Not sure why this is not happening
This is the code that should write to the excel sheet to say done.
Cells(xlrow, 6) = DONE
Here is the entire code and I have attached the excel sheet as well.
Sub DT_ACMAA()
'
' DT_ACMAA Macro
'
Dim bzhao As Object
Set bzhao = CreateObject("BZWhll.WhllObj")
bzhao.Connect ""
Dim myAsgn As Variant
Dim myRange As Excel.Range
Dim xlrow As Integer
DONE = "YES"
xlrow = 2
Set myRange = ActiveSheet.Range("B2:B52")
myAuth = Cells(xlrow, 5)
Delay_Code = Cells(xlrow, 3)
Delay_timeM = Cells(xlrow, 4)
For Each myAsgn In myRange
If myAsgn = "" Then
Exit For
End If
bzhao.sendkey "<PF3>"
bzhao.Wait 0.2
bzhao.sendkey "ACMAA"
bzhao.Wait 0.2
bzhao.sendkey "<enter>"
bzhao.Wait 0.2
bzhao.sendkey myAuth
bzhao.Wait 0.2
bzhao.sendkey "<TAB>"
bzhao.Wait 0.2
bzhao.sendkey "d"
bzhao.Wait 0.2
bzhao.sendkey "<tab>"
bzhao.Wait 0.2
bzhao.sendkey Delay_Code
bzhao.Wait 0.2
bzhao.sendkey myAsgn
bzhao.Wait 0.2
bzhao.sendkey "<tab>"
bzhao.Wait 0.2
bzhao.sendkey Delay_timeM
bzhao.Wait 0.2
bzhao.sendkey ":"
bzhao.Wait 0.2
bzhao.sendkey "0"
bzhao.Wait 0.2
bzhao.sendkey "0"
bzhao.Wait 0.2
bzhao.sendkey "<ENTER>"
bzhao.Wait 0.2
bzhao.sendkey "m"
bzhao.Wait 0.2
bzhao.sendkey "y"
bzhao.Wait 0.2
bzhao.sendkey "<ENTER>"
bzhao.Wait 0.2
bzhao.sendkey "e"
bzhao.Wait 0.2
bzhao.sendkey "e"
bzhao.Wait 0.2
Cells(xlrow, 6) = DONE
Next myAsgn
End Sub
1 Guest(s)