Malicious Office (OOXML) — malware analysis report

Static analysis result for SHA-256 2ceff6efc64faa86…

MALICIOUS

Office (OOXML)

166.5 KB Created: 2017-04-26 10:41:58 UTC Authoring application: Microsoft Excel 16.0300 First seen: 2021-05-04
MD5: b6bb7de57bf435d74f6b05642ae7611e SHA-1: 64426064f737a4a7af39ecb56592494f8f531daa SHA-256: 2ceff6efc64faa86e4116dc5bc9f96a127246ca5458620959f7db171925143f7
138 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic T1140 Deobfuscate or Obfuscate Malicious Files or Information T1071.001 Web Protocols

The sample is an Excel document containing VBA macros. The critical heuristic 'OLE_VBA_HTTP_DROP_EXEC' indicates that the VBA code downloads a file from an HTTP URL and writes it to disk. The embedded URLs suggest the macro attempts to download a second-stage payload. The document body contains what appears to be sensitive HR and employee data fields, suggesting a lure for credential harvesting or phishing.

Heuristics 6

  • VBA project inside OOXML medium 3 related findings OOXML_VBA
    Document contains a VBA project — VBA macros present
  • VBA downloads and writes a file to disk critical OLE_VBA_HTTP_DROP_EXEC
    VBA reads an HTTP response body and writes it to disk (ADODB.Stream SaveToFile). Combined with the auto-exec/Shell paths this is a download-drop dropper even when the COM ProgIDs are built dynamically to evade keyword scanning.
    Matched line in script
            S.write H.Responsebody
  • CreateObject call high OLE_VBA_CREATEOBJ
    CreateObject call
    Matched line in script
        Set objRegEx = CreateObject("vbscript.regexp")
  • Workbook_Open macro low OLE_VBA_WBOPEN
    Workbook_Open macro
    Matched line in script
    Private Sub Workbook_Open()
  • Hidden worksheet (hidden) low OOXML_HIDDEN_SHEET
    Excel workbook contains 7 hidden sheet(s) — hidden sheets are commonly used to conceal macro code, staging data, or intermediate payload construction
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://static.fescoadecco.com/rpa-2/hrs-standard.xlsm Referenced by macro
    • http://static.fescoadecco.com/rpa-2//hrs-standard-verReferenced by macro

Extracted artifacts 3

Files carved from inside the sample during analysis.

FilenameKindSourceSize
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source from OOXML) 89228 bytes
SHA-256: 38498ab79e112f88559a9449ce9a387d2f2ce4db91d5632db545a7fef933a730
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
On Error GoTo myerr:
    Dim result As Boolean
    result = Validate_All_Data
    If result = True Then
        ThisWorkbook.Sheets("EN_CN_Mapping").Range("D2") = "False"
    Else
        ThisWorkbook.Sheets("EN_CN_Mapping").Range("D2") = "True"
    End If
    Exit Sub
myerr:
    protect_workbook_structure
End Sub



Private Sub Workbook_Open()
    Call Verson_API
End Sub

Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet5"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Sheet2"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

'单元格发生变化时触发相应的验证逻辑
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim str_fun_name            As String
    Dim sht                     As Worksheet
    Dim str_value               As String
    Dim result                  As Boolean
    Dim header_name             As String
    
On Error GoTo myerr:
    displayOFF
    Set sht = ThisWorkbook.ActiveSheet
    '目标单元格不在有效区域
    If Target.Row < delegate_start_row Then Exit Sub
    '选择非单个单元格区域
    If Target.count > 1 Then Exit Sub
    '判断有效行
    If Verify_Blank_Row(sht, Target.Row) = True Then Exit Sub
    
    header_name = Get_Header_Name(sht, Target.Column)
    sht.Range(Target.Address).Interior.ColorIndex = 0
'    str_mr = ""
    str_fun_name = Get_In_Macro_Name(header_name)

    If str_fun_name <> "" Then
        str_value = Trim(sht.Range(Target.Address).Value)
        result = Application.Run(str_fun_name, sht, Target, str_value)
        If result = False Then
            sht.Range(Target.Address).Interior.ColorIndex = 3
        End If
    End If

    displayON
    Exit Sub
myerr:
    displayON
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim header_name As String
    Dim sht As Worksheet
    Dim result As String

On Error GoTo myerr:
    Set sht = ThisWorkbook.ActiveSheet
    header_name = Get_Header_Name(sht, Target.Column)
    
    Set sht = ThisWorkbook.ActiveSheet
    '目标单元格不在有效区域
    If Target.Row < delegate_start_row Then Exit Sub
    '选择非单个单元格区域
    If Target.count > 1 Then Exit Sub
    '判断有效行
    If Verify_Blank_Row(sht, Target.Row) = True Then Exit Sub
    
    sht.Unprotect str_password
    Target.Validation.Delete

    '[证件类型] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Certificate_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("A")
        End With
    End If

    '[银行类型] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Bank_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("B")
        End With
    End If

    '[工作制] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Working_System") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("C")
        End With
    End If

    '[是否发薪] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_to_Pay") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("D")
        End With
    End If

    '[是否报税] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_to_Tax") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("E")
        End With
    End If

    '[岗位] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Gang_Wei") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("H")
        End With
    End If

     '[是否有子女] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_Children") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("I")
        End With
    End If

    '[全国福利标准] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_National_Welfare_Standards") Then
        Dim city_column As Long
        Dim city_name As String

        city_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_City_Name"))
        city_name = Trim(sht.Cells(Target.Row, city_column).Value)
        result = Get_National_Welfare_Standards_Drop_list(city_name)
        If result <> "" And city_name <> "" Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=result
            End With
        End If
    End If
    '[账户市名称]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Account_City_Name") Then
        Dim province_column As Long
        Dim province_name As String

        province_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Account_Province_Name"))
        If province_column <> 0 Then
            province_name = Trim(sht.Cells(Target.Row, province_column).Value)
            result = Get_Province_City_List(province_name)
            If result <> "" And province_name <> "" Then
                With Target.Validation
                    .Delete
                    .Add Type:=xlValidateList, Formula1:=result
                End With
            End If
        End If
    End If
    '[是否联系员工]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_Employee") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("L")
        End With
    End If
    
    '[任职受雇从业类型]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_SGCY_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("M")
        End With
    End If
    
     '[人员属性]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_RY_Type") Then
        Dim type_column As Long
        Dim type_name As String

        type_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_SGCY_Type"))
        type_name = Trim(sht.Cells(Target.Row, type_column).Value)
        If InStr(type_name, Get_CN_Value("emp_type_guyuan")) > 0 Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=Get_Drop_list("N")
            End With
        End If
        If InStr(type_name, Get_CN_Value("emp_type_feiguyuan")) > 0 Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=Get_Drop_list("O")
            End With
        End If
    End If
    
    Call Protect_sht(sht)
    displayON
    Exit Sub
myerr:
    displayON
    Call Protect_sht(sht)
End Sub


Attribute VB_Name = "Sheet3"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

'单元格发生变化时触发相应的验证逻辑
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim str_fun_name            As String
    Dim sht                     As Worksheet
    Dim str_value               As String
    Dim result                  As Boolean
    Dim header_name             As String
    
On Error GoTo myerr:
    displayOFF
    Set sht = ThisWorkbook.ActiveSheet
    '目标单元格不在有效区域
    If Target.Row < delegate_start_row Then Exit Sub
    '选择非单个单元格区域
    If Target.count > 1 Then Exit Sub
    '判断有效行
    If Verify_Blank_Row(sht, Target.Row) = True Then Exit Sub
    
    header_name = Get_Header_Name(sht, Target.Column)
    sht.Range(Target.Address).Interior.ColorIndex = 0
'    str_mr = ""
    str_fun_name = Get_In_Macro_Name(header_name)

    If str_fun_name <> "" Then
        str_value = Trim(sht.Range(Target.Address).Value)
        result = Application.Run(str_fun_name, sht, Target, str_value)
        If result = False Then
            sht.Range(Target.Address).Interior.ColorIndex = 3
        End If
    End If

    displayON
    Exit Sub
myerr:
    displayON
End Sub


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim header_name As String
    Dim sht As Worksheet
    Dim result As String

On Error GoTo myerr:
    Set sht = ThisWorkbook.ActiveSheet
    header_name = Get_Header_Name(sht, Target.Column)
    
    Set sht = ThisWorkbook.ActiveSheet
    '目标单元格不在有效区域
    If Target.Row < delegate_start_row Then Exit Sub
    '选择非单个单元格区域
    If Target.count > 1 Then Exit Sub
    '判断有效行
    If Verify_Blank_Row(sht, Target.Row) = True Then Exit Sub
    
    sht.Unprotect str_password
    Target.Validation.Delete

    '[证件类型] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Certificate_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("A")
        End With
    End If

    '[银行类型] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Bank_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("B")
        End With
    End If

    '[工作制] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Working_System") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("C")
        End With
    End If

    '[是否发薪] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_to_Pay") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("D")
        End With
    End If

    '[是否报税] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_to_Tax") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("E")
        End With
    End If

    '[岗位] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Work_Position_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("H")
        End With
    End If

     '[是否有子女] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_Children") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("I")
        End With
    End If
    
    '[外包类型] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Outsourcing_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("G")
        End With
    End If

    '[全国福利标准] 下拉框列表
    If header_name = Get_in_CN_Header_Name("In_National_Welfare_Standards") Then
        Dim city_column As Long
        Dim city_name As String

        city_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_City_Name"))
        city_name = Trim(sht.Cells(Target.Row, city_column).Value)
        result = Get_National_Welfare_Standards_Drop_list(city_name)
        If result <> "" And city_name <> "" Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=result
            End With
        End If
    End If
    
    '[劳务属性]
    If header_name = Get_in_CN_Header_Name("In_Labor_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("K")
        End With
    End If
    
    
    '[账户市名称]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Account_City_Name") Then
        Dim province_column As Long
        Dim province_name As String

        province_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Account_Province_Name"))
        If province_column <> 0 Then
            province_name = Trim(sht.Cells(Target.Row, province_column).Value)
            result = Get_Province_City_List(province_name)
            If result <> "" And province_name <> "" Then
                With Target.Validation
                    .Delete
                    .Add Type:=xlValidateList, Formula1:=result
                End With
            End If
        End If
    End If
    
     '[是否联系员工]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_Whether_Employee") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("L")
        End With
    End If
    
    '[任职受雇从业类型]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_SGCY_Type") Then
        With Target.Validation
            .Delete
            .Add Type:=xlValidateList, Formula1:=Get_Drop_list("M")
        End With
    End If
    
     '[人员属性]下拉框列表
    If header_name = Get_in_CN_Header_Name("In_RY_Type") Then
        Dim type_column As Long
        Dim type_name As String

        type_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_SGCY_Type"))
        type_name = Trim(sht.Cells(Target.Row, type_column).Value)
        If InStr(type_name, Get_CN_Value("emp_type_guyuan")) > 0 Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=Get_Drop_list("N")
            End With
        End If
        If InStr(type_name, Get_CN_Value("emp_type_feiguyuan")) > 0 Then
            With Target.Validation
                .Delete
                .Add Type:=xlValidateList, Formula1:=Get_Drop_list("O")
            End With
        End If
    End If
    
    Call Protect_sht(sht)
    displayON
    Exit Sub
myerr:
    displayON
    Call Protect_sht(sht)
End Sub



Attribute VB_Name = "InDataValidation"
Option Explicit
Option Base 1


Private macro_mapping_sheetname   As String


'公司名字
Function In_Company_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("company_name_blank"))
        In_Company_Name = False
    Else
        In_Company_Name = True
    End If

End Function

 '员工姓名
Function In_Worker_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("worker_name_blank"))
        In_Worker_Name = False
    Else
        In_Worker_Name = True
    End If
End Function

'证件类型
Function In_Certificate_Type(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim str_id As String
    str_id = Trim(sht.Range(Target.Address).Offset(, 1).Value)
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("certificate_type_blank"))
        In_Certificate_Type = False
        Exit Function
    End If
    In_Certificate_Type = True
End Function

'证件号
Function In_Certificate_Number(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("certificate_number_blank"))
        In_Certificate_Number = False
    ElseIf ID_validation(str_value) = False And sht.Range(Target.Address).Offset(, -1).Value = Get_CN_Value("id_card") Then
        Alert_Msg (Get_CN_Value("certificate_number_incorrect"))
        In_Certificate_Number = False
    Else
        In_Certificate_Number = True
    End If
End Function

'手机号
Function In_Phone_Number(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("phone_number_blank"))
        In_Phone_Number = False
    ElseIf Phone_validation(str_value) = False Then
        Alert_Msg (Get_CN_Value("phone_number_incorrect"))
        In_Phone_Number = False
    Else
        In_Phone_Number = True
    End If
End Function

'外包类型
Function In_Outsourcing_Type(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("outsourcing_type_blank"))
        In_Outsourcing_Type = False
        Exit Function
    End If
    In_Outsourcing_Type = True
End Function

'入职时间
Function In_Hire_Date(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("hire_date_blank"))
        In_Hire_Date = False
    ElseIf IsDate(str_value) = False Then
        Alert_Msg (Get_CN_Value("hire_date_incorrect"))
        In_Hire_Date = False
    Else
        In_Hire_Date = True
    End If
End Function

'社保福利起始时间
Function In_Social_Insurance_Benefit_Start_Date(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim housing_fund_column As Long
    housing_fund_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Housing_Fund_Benefit_Start_Date"))
    If str_value <> "" Then
        If IsDate(str_value) = False Or Date_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("social_insurance_benefit_start_date_incorrect"))
            In_Social_Insurance_Benefit_Start_Date = False
            Exit Function
        ElseIf Day(CDate(str_value)) <> 1 Then
            Alert_Msg (Get_CN_Value("social_insurance_benefit_start_date_should_day1"))
            In_Social_Insurance_Benefit_Start_Date = False
            Exit Function
        Else
            In_Social_Insurance_Benefit_Start_Date = True
            If Trim(sht.Cells(Target.Row, housing_fund_column).Value) = "" Then
                sht.Cells(Target.Row, housing_fund_column).Value = str_value
            End If
        End If
    End If
    In_Social_Insurance_Benefit_Start_Date = True
End Function

'公积金福利起始时间
Function In_Housing_Fund_Benefit_Start_Date(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" Then
        If IsDate(str_value) = False Or Date_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("housing_fund_benefit_start_date_incorrect"))
            In_Housing_Fund_Benefit_Start_Date = False
            Exit Function
        ElseIf Day(CDate(str_value)) <> 1 Then
            Alert_Msg (Get_CN_Value("housing_fund_benefit_start_date_should_day1"))
            In_Housing_Fund_Benefit_Start_Date = False
            Exit Function
        Else
            In_Housing_Fund_Benefit_Start_Date = True
        End If
    End If
    In_Housing_Fund_Benefit_Start_Date = True
End Function


'城市名称
Function In_City_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim Standards_column As Long
    Standards_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_National_Welfare_Standards"))
   
    
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("city_name_not_blank"))
        In_City_Name = False
    ElseIf Get_Welfare_Place(str_value) = False Then
        Alert_Msg (Get_CN_Value("city_name_incorrect"))
        In_City_Name = False
    Else
        In_City_Name = True
    End If
    If Standards_column <> 0 Then
        If str_mr <> "mr" Then
            sht.Cells(Target.Row, Standards_column) = ""
        End If
    End If
End Function

 '社保福利标准
Function In_National_Welfare_Standards(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim city_column As Long
    Dim city_name As String
    
    city_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_City_Name"))
    city_name = Trim(sht.Cells(Target.Row, city_column).Value)
    If str_value = "" Then
        If city_name = Get_CN_Value("city_suzhou") Or city_name = Get_CN_Value("city_shenzhen") Then
            Alert_Msg (Get_CN_Value("national_welfare_standards_blank"))
            In_National_Welfare_Standards = False
            Exit Function
        End If
    End If
    In_National_Welfare_Standards = True
End Function

'社会保险基数
Function In_Social_Insurance_Base(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" And str_value <> Get_CN_Value("floor_level") Then
        If IsNumeric(str_value) = False Then
            Alert_Msg (Get_CN_Value("social_insurance_base_incorrect"))
            In_Social_Insurance_Base = False
            Exit Function
        Else
            If Val(str_value) < 1000 Then
                Alert_Msg (Get_CN_Value("housing_fund_base_less1000"))
                In_Social_Insurance_Base = False
                Exit Function
            End If
        End If
    End If
    In_Social_Insurance_Base = True
End Function

'住房公积金基数
Function In_Housing_Fund_Base(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim city_column                 As Long
    Dim Individual_column           As Long
    Dim Enterprise_column           As Long
    Dim city_name                   As String
    Dim Individual_value            As String
    Dim Enterprise_value            As String
    
    If str_value <> "" And str_value <> Get_CN_Value("floor_level") Then
        If IsNumeric(str_value) = False Then
            Alert_Msg (Get_CN_Value("housing_fund_base_incorrect"))
            In_Housing_Fund_Base = False
            Exit Function
        Else
            If Val(str_value) < 1000 Then
                Alert_Msg (Get_CN_Value("housing_fund_base_less1000"))
                In_Housing_Fund_Base = False
                Exit Function
            End If
        End If
    End If
    In_Housing_Fund_Base = True
End Function

'是否有子女
Function In_Whether_Children(sht As Worksheet, Target As Range, str_value As String) As Boolean
    In_Whether_Children = True
End Function

'住房公积金个人比例
Function In_Individual_Ratio_of_Housing_Fund(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim city_column                 As Long
    Dim base_column                 As Long
    Dim Individual_column           As Long
    Dim city_name                   As String
    Dim Individual_value            As String
    Dim base_value                  As String
    
    city_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_City_Name"))
    city_name = Trim(sht.Cells(Target.Row, city_column).Value)
    
    base_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Housing_Fund_Base"))
    If base_column <> 0 Then
        base_value = Trim(sht.Cells(Target.Row, base_column).Value)
        
        Individual_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Individual_Ratio_of_Housing_Fund"))
        Individual_value = Trim(sht.Cells(Target.Row, Individual_column).Value)
        
        If Individual_value <> "" Then
            If base_value = "" Then
                Alert_Msg (Get_CN_Value("individual_ratio_of_housing_fund_base_blank"))
                In_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            ElseIf IsNumeric(Individual_value) = False Then
                Alert_Msg (Get_CN_Value("individual_ratio_of_housing_fund_incorrect"))
                In_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        Else
            If base_value <> "" And city_name <> Get_CN_Value("city_shanghai") Then
                Alert_Msg (Get_CN_Value("individual_ratio_of_housing_fund_blank"))
                In_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        End If
    End If
    In_Individual_Ratio_of_Housing_Fund = True
End Function

'住房公积金企业比例
Function In_Enterprise_Ratio_of_Housing_Fund(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim city_column                 As Long
    Dim base_column                 As Long
    Dim Enterprise_column           As Long
    Dim city_name                   As String
    Dim Enterprise_value            As String
    Dim base_value                  As String
    
    city_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_City_Name"))
    city_name = Trim(sht.Cells(Target.Row, city_column).Value)
    
    base_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Housing_Fund_Base"))
    If base_column <> 0 Then
        base_value = Trim(sht.Cells(Target.Row, base_column).Value)
        
        Enterprise_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Enterprise_Ratio_of_Housing_Fund"))
        Enterprise_value = Trim(sht.Cells(Target.Row, Enterprise_column).Value)
        
        If Enterprise_value <> "" Then
            If base_value = "" Then
                Alert_Msg (Get_CN_Value("enterprise_ratio_of_housing_fund_base_blank"))
                In_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            ElseIf IsNumeric(Enterprise_value) = False Then
                Alert_Msg (Get_CN_Value("enterprise_ratio_of_housing_fund_incorrect"))
                In_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        Else
            If base_value <> "" And city_name <> Get_CN_Value("city_shanghai") Then
                Alert_Msg (Get_CN_Value("enterprise_ratio_of_housing_fund_blank"))
                In_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        End If
    End If
    In_Enterprise_Ratio_of_Housing_Fund = True
    
End Function

'补充住房公积金基数
Function In_Supplementary_Housing_Fund_Base(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim city_column                 As Long
    Dim Individual_column           As Long
    Dim Enterprise_column           As Long
    Dim city_name                   As String
    Dim Individual_value            As String
    Dim Enterprise_value            As String
    
    If str_value <> "" Then
        If IsNumeric(str_value) = False Then
            Alert_Msg (Get_CN_Value("supplementary_housing_fund_base_incorrect"))
            In_Supplementary_Housing_Fund_Base = False
            Exit Function
        End If
    End If
    
    In_Supplementary_Housing_Fund_Base = True
End Function

'补充住房公积金个人比例
Function In_Supplementary_Individual_Ratio_of_Housing_Fund(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim base_column                 As Long
    Dim Individual_column           As Long
    Dim Individual_value            As String
    Dim base_value                  As String
    
    
    base_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Supplementary_Housing_Fund_Base"))
    If base_column <> 0 Then
        base_value = Trim(sht.Cells(Target.Row, base_column).Value)
        
        Individual_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Supplementary_Individual_Ratio_of_Housing_Fund"))
        Individual_value = Trim(sht.Cells(Target.Row, Individual_column).Value)
        
        If Individual_value <> "" Then
            If base_value = "" Then
                Alert_Msg (Get_CN_Value("supplementary_individual_ratio_of_housing_fund_base_blank"))
                In_Supplementary_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            ElseIf IsNumeric(Individual_value) = False Then
                Alert_Msg (Get_CN_Value("supplementary_individual_ratio_of_housing_fund_incorrect"))
                In_Supplementary_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        Else
            If base_value <> "" Then
                Alert_Msg (Get_CN_Value("supplementary_individual_ratio_of_housing_fund_blank"))
                In_Supplementary_Individual_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        End If
    End If
    In_Supplementary_Individual_Ratio_of_Housing_Fund = True
End Function

 '补充住房公积金企业比例
Function In_Supplementary_Enterprise_Ratio_of_Housing_Fund(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim base_column                 As Long
    Dim Enterprise_column           As Long
    Dim Enterprise_value            As String
    Dim base_value                  As String
    
    
    base_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Supplementary_Housing_Fund_Base"))
    If base_column <> 0 Then
        base_value = Trim(sht.Cells(Target.Row, base_column).Value)
        
        Enterprise_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Supplementary_Enterprise_Ratio_of_Housing_Fund"))
        Enterprise_value = Trim(sht.Cells(Target.Row, Enterprise_column).Value)
        
        If Enterprise_value <> "" Then
            If base_value = "" Then
                Alert_Msg (Get_CN_Value("supplementary_enterprise_ratio_of_housing_fund_base_blank"))
                In_Supplementary_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            ElseIf IsNumeric(Enterprise_value) = False Then
                Alert_Msg (Get_CN_Value("supplementary_enterprise_ratio_of_housing_fund_incorrect"))
                In_Supplementary_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        Else
            If base_value <> "" Then
                Alert_Msg (Get_CN_Value("supplementary_enterprise_ratio_of_housing_fund_blank"))
                In_Supplementary_Enterprise_Ratio_of_Housing_Fund = False
                Exit Function
            End If
        End If
    End If
    In_Supplementary_Enterprise_Ratio_of_Housing_Fund = True
End Function



'是否发薪
Function In_Whether_to_Pay(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("whether_to_pay_blank"))
        In_Whether_to_Pay = False
        Exit Function
    End If
    In_Whether_to_Pay = True
End Function

'是否报税
Function In_Whether_to_Tax(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value = "" Then
        Alert_Msg (Get_CN_Value("whether_to_tax_blank"))
        In_Whether_to_Tax = False
        Exit Function
    End If
    In_Whether_to_Tax = True
End Function



'邮政编码
Function In_Postal_Code(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" Then
        If Postal_Code_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("postal_code_incorrect"))
            In_Postal_Code = False
            Exit Function
        End If
    End If
    In_Postal_Code = True
End Function


'电子邮件
Function In_Mail_Address(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" Then
        If Mail_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("mail_address_incorrect"))
            In_Mail_Address = False
            Exit Function
        End If
    End If
    In_Mail_Address = True
End Function

'开户银名称
Function In_Bank_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" Then
        If Chinese_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("bank_name_incorrect"))
            In_Bank_Name = False
            Exit Function
        End If
    End If
    In_Bank_Name = True
End Function

'帐号
Function In_Account_Number(sht As Worksheet, Target As Range, str_value As String) As Boolean
    If str_value <> "" Then
        If BankID_validation(str_value) = False Then
            Alert_Msg (Get_CN_Value("account_number_incorrect"))
            In_Account_Number = False
            Exit Function
        End If
    End If
    In_Account_Number = True
End Function

'帐号省名
Function In_Account_Province_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim str_province As String
    Dim province_name As String
    
    If str_value <> "" Then
        If Get_Province_List(str_value) = False Then
            Alert_Msg (Get_CN_Value("account_province_name_incorrect"))
            In_Account_Province_Name = False
            Exit Function
        End If
    End If
    In_Account_Province_Name = True
End Function

'帐号市区名
Function In_Account_City_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
'    Dim str_city As String
'    Dim city_name As String
'
'    str_city = Get_CN_Value("city")
'    city_name = str_city
'    If str_value <> "" Then
'        If InStr(str_value, str_city) <> Len(str_value) Or Get_City_List(city_name) = False Then
'            Alert_Msg (Get_CN_Value("account_city_name_incorrect"))
'            In_Account_City_Name = False
'            Exit Function
'        End If
'    End If
    In_Account_City_Name = True
End Function

'账户名
Function In_Account_Name(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim emp_name                   As String
    Dim emp_column                 As Long

    emp_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Worker_Name"))
    emp_name = Trim(sht.Cells(Target.Row, emp_column).Value)
    If str_value <> "" Then
        If str_value <> emp_name Then
            Alert_Msg (Get_CN_Value("account_name_incorrect"))
            In_Account_Name = False
            Exit Function
        End If
    End If
    In_Account_Name = True
End Function

'银行类别
Function In_Bank_Type(sht As Worksheet, Target As Range, str_value As String)
    In_Bank_Type = True
End Function


'派遣期限起始日期
Function In_Dispatch_Start_Date(sht As Worksheet, Target As Range, str_value As String) As Boolean
    Dim outsouring_type_column As Long
    Dim outsouring_type_value As String
    
    outsouring_type_column = Get_Header_Column(sht, Get_in_CN_Header_Name("In_Outsourcing_Type"))
    outsouring_type_value = Trim(sht.Cells(Target.Row, outsouring_type_column).Value)
    
    If outsouring_type_value = Get_CN_Value("dispatch") Then
        If str_value = "" Then
            Alert_Msg (Get_CN_Value("dispatch_start_date_blank"))
            In_Dispatch_Start_Date = False
…
vbaProject_00.bin vba-project OOXML VBA project: xl/vbaProject.bin 240640 bytes
SHA-256: 4d2df9ef1ee50a66390d7a9cd7678fd8e82c88990fc14ddf25850772d112a3f6
emf_00.emf ooxml-emf OOXML EMF part: xl/media/image3.emf 2692 bytes
SHA-256: 1280934507f284a4ec287dcd54f49fde1bd0c24bc75815d48a9cf16538dfd75e