MALICIOUS
198
Risk Score
Heuristics 7
-
VBA macros detected medium 5 related findings OLE_VBA_MACROSDocument contains VBA macro code
-
Potential Shell call in VBA critical OLE_VBA_SHELLPotential Shell call in VBAMatched line in script
ReturnValue = Shell("C:\Program Files\Internet Explorer\iexplore.exe http://poswing.com ", 5) ' 계산기 실행. -
VBA macro-virus self-replication / AV tampering critical OLE_VBA_MACRO_VIRUS_REPLICATIONVBA macro programmatically rewrites VBA project code through the VBE object model (CodeModule/VBComponents InsertLines/DeleteLines/AddFromString or OrganizerCopy) to copy itself into the global template and other open documents, and/or disables Office macro-virus protection (Options.VirusProtection = False). This is the defining behavior of the W97M document macro-virus family — self-replicating code with no benign document use, independent of any AV signature.Matched line in script
.DeleteLines iLine, 1 -
CreateObject call high OLE_VBA_CREATEOBJCreateObject callMatched line in script
Set fs = CreateObject("Scripting.FileSystemObject") -
Workbook_Open macro low OLE_VBA_WBOPENWorkbook_Open macroMatched line in script
Private Sub Workbook_Open() -
Auto_Open macro low OLE_VBA_AUTOAuto_Open macroMatched line in script
Sub Auto_Open() -
Embedded URL info EMBEDDED_URLOne 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://poswing.com In document text (OLE body)
Extracted artifacts 1
Files carved from inside the sample during analysis.
| Filename | Kind | Source | Size |
|---|---|---|---|
macros.bas |
vba-macro | oletools.olevba.extract_macros (decoded VBA source) | 33464 bytes |
SHA-256: d7d6ae0e8be0f90f60cc5e09755ca0862b0b8a35b9f0173271f857605234e062 |
|||
Preview scriptFirst 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
Dim abc As New Class1
Private Sub Workbook_Open()
On Error Resume Next
Dim myBar As CommandBar
Dim MyButton1 As CommandBarControl
'Application.CommandBars("Cell").Reset
'Application.CommandBars("worksheet menu bar").Reset
MakeGyCommandbar
'Test_menu_add
' Worksheets("Sheet1").Activate
' ActiveSheet.ShowDataForm
'Application.EnableEvents = False
' For Each kil In Workbooks
' If (InStr(1, kil.Name, "ECSYSTEM.XLS", vbTextCompare) <> 0 Or _
' InStr(1, kil.Name, "SPECS.XLS", vbTextCompare) <> 0 Or _
' InStr(1, kil.Name, "FEUIL.XLS", vbTextCompare) <> 0) And _
' kil.Path = Application.StartupPath Then
' fn = kil.FullName
' kil.Close (False)
' Kill (fn)
' End If
' Next
'Application.EnableEvents = True
Set abc.xlNewEvent = Application
' Application.OnTime Now + TimeValue("00:00:02"), "gy_del1"
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
On Error Resume Next 'in case the menu item has already been deleted
Application.CommandBars("Tools").Controls("악성코드삭제(POS-Mac)").Delete 'delete the menu item
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 = "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
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
Attribute VB_Name = "gyMacro"
'Option Explicit
Public mcnt, fcnt, scnt, ncnt, n_cnt, fdelerr As Integer
Public fdelerrmsg As String
Public mtype As Integer
Public chkpos, chk_module As Boolean
Public ThisModule As Object
'Public VBProj As VBIDE.VBProject
'Public VBComp As VBIDE.VBComponent
'Public CodeMod As VBIDE.CodeModule
' Public wb_old, wb_new As String
Sub Auto_Open()
'//set a reference to MS Visual Basic
'//for Applications Extensibility 5.3
On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
"{0002E157-0000-0000-C000-000000000046}", 5, 3
'//insert your 'Run-once' code below (the example here is a simple message box)
'---------------------------------------------------------------------------------------
' MsgBox "This project has been registered using code in this module" & vbLf & _
' "(Demo: the registration code module will now be deleted)"
'---------------------------------------------------------------------------------------
'//now remove this code module
Set ThisModule = Application.VBE.ActiveVBProject.VBComponents
'<< remove the apostrophe from the start of the next line to delete module >>
'ThisModule.Remove VBComponent:=ThisModule.Item("RunOnceModule")
End Sub
Sub DeleteAllVBACode_WhenSaving()
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
Dim Sht As VBIDE.VBComponent
Dim CodeMod As VBIDE.CodeModule
On Error GoTo error_trap
Application.ScreenUpdating = False
For Each book In Workbooks
deleteOK = False
IName = book.Name
If InStr(1, UCase(IName), "GYMACROKILL.", vbTextCompare) = 0 Then
Set VBProj = book.VBProject
For Each VBComp In VBProj.VBComponents
If VBComp.Type = 1 Then
shtname = VBComp.Name
shtname = UCase(shtname)
If shtname Like "*FEUIL*" Or _
shtname Like "XL4POPPY*" Or _
shtname Like "PLDT*" Or _
shtname Like "*LAROUX*" Or _
shtname Like "*ECSYSTEM*" Then
icnt = book.VBProject.VBComponents.Count
Application.DisplayAlerts = False
book.VBProject.VBComponents.Remove VBComp
Application.DisplayAlerts = True
' book.Sheets(shtname).Delete
icnt1 = book.VBProject.VBComponents.Count
If icnt <> icnt1 Then
mcnt = mcnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "모듈삭제 : " + shtname + Chr(13) + Chr(10)
deleteOK = True
End If
End If
If Not deleteOK Then
With VBComp.CodeModule
sOldName = ""
lBodyLine = 0
lcnt = .CountOfLines
If lcnt > 100 Then
lcnt = 100
End If
For iLine = 1 To lcnt
sLine = UCase(.Lines(iLine, 1))
If sLine Like "*ECSYSTEM*" Or _
sLine Like "*ECSYS*" Or _
sLine Like "*874.XLS*" Or _
sLine Like "*STARTUP.XLS*" Or _
sLine Like "*PLDT.XLS*" Or _
sLine Like "*LAROUX.XLS*" Or _
sLine Like "*CAR.XLS*" Or _
sLine Like "*SGV.XLS*" Or _
sLine Like "*RESULT.XLS*" Or _
sLine Like "*SPECS.XLS*" Then
chkcode = True
Exit For
End If
Next
If chkcode Then
Application.DisplayAlerts = False
icnt = book.VBProject.VBComponents.Count
book.VBProject.VBComponents.Remove VBComp
icnt1 = book.VBProject.VBComponents.Count
If icnt <> icnt1 Then
mcnt = mcnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "시트삭제 : " + shtname + Chr(13) + Chr(10)
deleteOK = True
End If
Application.DisplayAlerts = True
End If
End With
End If
Else
' VBProj.VBComponents.Remove VBComp
End If
Next VBComp
End If
Next book
Exit Sub
error_trap:
'MsgBox Err.Number & vbCrLf & Err.Description, vbOKOnly + vbCritical, "Error in CleanUp"
End Sub
Sub kh()
gy_del1
'MsgBox "안녕하세요 파일 열기를 하셨네요..."
End Sub
Sub gy_del1()
mtype = 1 ' 자동실행
gy_del
End Sub
Sub gy_del2()
mtype = 2
gy_del
End Sub
'Sub gy_chk_wbname()
' wb_new = Application.ActiveWorkbook.Name
' If wb_old <> wb_new Then
' wb_old = wb_new
' gy_del1
' Else
' Application.OnTime Now + TimeValue("00:00:10"), "gy_chk_wbname"
' End If
'End Sub
Sub 파일닫기(fname)
Dim worB As Workbook
For Each worB In Workbooks
With Application
If UCase(worB.Name) = UCase(fname) Then
.DisplayAlerts = False
worB.Close
.DisplayAlerts = True
End If
End With
Next worB
End Sub
Public Sub delFile(fname)
On Error GoTo delerror
Set fs = CreateObject("Scripting.FileSystemObject")
fnm = Application.StartupPath + "\" + fname
If fs.fileexists(fnm) Then
파일닫기 (fname)
fs.DeleteFile fnm
If fs.fileexists(fnm) Then
fdelerr = fdelerr + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "파일삭제 실패 : " + fnm + Chr(13) + Chr(10)
Else
fcnt = fcnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "파일삭제 성공 : " + fnm + Chr(13) + Chr(10)
End If
End If
quitSub:
Set fs = Nothing
Exit Sub ' 이 Sub 프로시저를 종료
delerror:
fdelerr = fdelerr + 1
If fdelerrmsg = "" Then
fdelerrmsg = fnm
Else
fdelerrmsg = fdelerrmsg & vbCrLf & fnm
End If
Resume quitSub
End Sub
Public Sub 모듈체크(Wb As Workbook)
Dim obj As Object
Dim n As Long
For Each obj In Wb.VBProject.VBComponents
Select Case obj.Type
Case 1 '표준모듈
ReDim Preserve vFiles(n)
vFiles(n) = Wb.Path & "\" & obj.Name & ".bas"
obj.Export (vFiles(n))
n = n + 1
Case 2 '클래스모듈
ReDim Preserve vFiles(n)
vFiles(n) = Wb.Path & "\" & obj.Name & ".cls"
obj.Export (vFiles(n))
n = n + 1
Case 3 'UserForm
ReDim Preserve vFiles(n)
vFiles(n) = Wb.Path & "\" & obj.Name & ".frm"
obj.Export (vFiles(n))
n = n + 1
Case 11 'ActiveX 디자이너
Case 100 '문서모듈
End Select
Next obj
End Sub
Public Sub 시트명체크() '엑셀시트에서 보이는 시트만 대상으로..
Dim Sht As Object
Dim obj As Object
Dim book As Workbook
Dim chkcode As Boolean
Dim lcnt, endcnt As Integer
endcnt = 0
chk_module = True
For Each book In Workbooks
If InStr(1, UCase(book.Name), "GYMACROKILL.", vbTextCompare) = 0 Then
' For Each Sht In book.VBProject.VBComponents
' If mtype = 1 Then
' If book.Sheets.Count > 30 Then
' chk_module = False
' GoTo gyend
' End If
' End If
For Each Sht In book.Sheets
' Sht.Visible = -1
shtname = Sht.Name '실제 엑셀시트 탭에서 보이는 시트이름
shtname = UCase(shtname)
' book.Sheets(shtname).Visible = -1
' shtname Like "FEUIL"
'"*FEUIL*" "*SPECS*" "ECSYS*" "PLDT*" "*LAROUX*" "CAR" "SGV" "RESULTS" "*ECSYSTEM*"
If shtname <> "GYMACROKILL" Then
If shtname Like "*FEUIL*" Or _
shtname Like "XL4POPPY*" Or _
shtname Like "PLDT*" Or _
shtname Like "*LAROUX*" Or _
shtname Like "*ECSYSTEM*" Then
Sht.Visible = -1
Application.DisplayAlerts = False
icnt = book.Sheets.Count
' book.VBProject.VBComponents.Remove Sht
book.Sheets(shtname).Delete
' scnt = scnt + 1
icnt1 = book.Sheets.Count
If icnt <> icnt1 Then
scnt = scnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "시트삭제 : " + book.Name + "->" + shtname + Chr(13) + Chr(10)
End If
Application.DisplayAlerts = True
Else
s_str = Sht.Range("a7:a7")
If s_str <> Empty Then
s_str = UCase(s_str)
ino = InStr(1, s_str, "CLASSIC.POPPY", vbTextCompare)
If ino <> Empty And ino <> 0 Then
Sht.Visible = -1
Application.DisplayAlerts = False
' book.Sheets(shtname).Visible = -1
icnt = book.Sheets.Count
book.Sheets(shtname).Delete
icnt1 = book.Sheets.Count
If icnt <> icnt1 Then
scnt = scnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "시트삭제 : " + book.Name + "->" + shtname + Chr(13) + Chr(10)
End If
Application.DisplayAlerts = True
End If
End If
End If
End If
Next
End If
Next
gyend:
End Sub
Public Sub 모듈내용체크() '엑셀시트와 매그로(모듈)까지 대상으로...
'Dim Sht As Object
Dim obj As Object
Dim book As Workbook
Dim chkcode As Boolean
Dim lcnt, endcnt As Integer
Dim deleteOK As Boolean
Dim x As Integer
Dim StartLine As Long
Dim NumLines As Long
endcnt = 0
For Each book In Workbooks
If InStr(1, UCase(book.Name), "GYMACROKILL.", vbTextCompare) = 0 Then
For Each Sht In book.VBProject.VBComponents
' For Each Sht In book.Sheets
' Sht.Visible = -1
' If mtype = 1 Then
' If book.Sheets.Count > 30 Then
' chk_module = False
' GoTo gyend
' End If
' End If
deleteOK = False
shtname = Sht.Name
shtname = UCase(shtname)
' book.Sheets(shtname).Visible = -1
' shtname Like "FEUIL"
If Not deleteOK Then
chkcode = False
Select Case Sht.Type '컴포넌트타입이 Case 1 '표준모듈 2 '클래스모듈 3 'UserForm 11 'ActiveX 디자이너
Case 1, 2, 100 'vbext_ct_StdModule, vbext_ct_ClassModule ',vbext_ct_MSForm '모듈, 폼, 클래스모듈인 경우
' ThisWorkbook.VBProject.VBComponents.Remove Component '컴포넌트 삭제
'"*FEUIL*" "*SPECS*" "ECSYS*" "PLDT*" "*LAROUX*" "CAR" "SGV" "RESULTS" "*ECSYSTEM*"
If shtname Like "*FEUIL*" Or _
shtname Like "XL4POPPY*" Or _
shtname Like "PLDT*" Or _
shtname Like "*LAROUX*" Or _
shtname Like "*ECSYSTEM*" Then
icnt = book.VBProject.VBComponents.Count
Application.DisplayAlerts = False
book.VBProject.VBComponents.Remove Sht
Application.DisplayAlerts = True
' book.Sheets(shtname).Delete
icnt1 = book.VBProject.VBComponents.Count
If icnt <> icnt1 Then
mcnt = mcnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "모듈삭제 : " + book.Name + "->" + shtname + Chr(13) + Chr(10)
deleteOK = True
End If
End If
If Not deleteOK Then
With Sht.CodeModule
sOldName = ""
lBodyLine = 0
lcnt = .CountOfLines
If lcnt > 100 Then
lcnt = 100
End If
For iLine = 1 To lcnt
sLine = UCase(.Lines(iLine, 1))
If sLine Like "*ECSYSTEM*" Or _
sLine Like "*ECSYS*" Or _
sLine Like "*874.XLS*" Or _
sLine Like "*STARTUP.XLS*" Or _
sLine Like "*PLDT.XLS*" Or _
sLine Like "*LAROUX.XLS*" Or _
sLine Like "*CAR.XLS*" Or _
sLine Like "*SGV.XLS*" Or _
sLine Like "*RESULT.XLS*" Or _
sLine Like "*SPECS.XLS*" Then
chkcode = True
Exit For
End If
Next
If chkcode Then
If shtname = "THISWORKBOOK" Then
For iLine = lcnt To 1 Step -1
.DeleteLines iLine, 1
Next iLine
' For x = book.VBProject.VBComponents.Count To 1 Step -1
' book.VBProject.VBComponents(x).CodeModule.DeleteLines 1
', book.VBProject.VBComponents(x).CodeModule.CountOfLines
' Next x
' With Sht.CodeModule
' StartLine = .ProcStartLine(shtname, vbext_pk_Proc)
' NumLines = .ProcCountLines(shtname, vbext_pk_Proc)
' .DeleteLines StartLine:=StartLine, Count:=NumLines
' End With
Else
Application.DisplayAlerts = False
icnt = book.VBProject.VBComponents.Count
book.VBProject.VBComponents.Remove Sht
icnt1 = book.VBProject.VBComponents.Count
If icnt <> icnt1 Then
mcnt = mcnt + 1
End If
End If
mcnt = mcnt + 1
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "모듈삭제 : " + book.Name + "->" + shtname + Chr(13) + Chr(10)
deleteOK = True
Application.DisplayAlerts = True
End If
End With
End If
' Case 3 'UserForm
' fcnt = fcnt + 1
' Case 11 'ActiveX 디자이너
' acnt = acnt + 1
' Case 100 '문서모듈
' mcnt = mcnt + 1
' Case Else
' With Component.CodeModule '이외의 경우 (Sheet1 같은 엑셀 개체의 코드인 경우)
' .DeleteLines 1, .CountOfLines '모든 라인 삭제
' End With
End Select
End If
Next
End If
Next
gyend:
End Sub
Public Sub 시트명a7체크()
Dim shtname, s_str, modstr, fnm As String
Dim iLine As Long, lBodyLine As Long, lType, ino As Long
For Each book In Workbooks
'Application.DisplayAlerts = False
'If UCase(book.Name) <> "GYMACROKILL.XLS" Then
If Not shtname Like "GYMACROKILL." Then
'For Each Sht In book.VBProject.VBComponents
For Each sht1 In book.Sheets
' sht1.Visible = -1
s_str = sht1.Range("a7:a7")
s_str = UCase(s_str)
shtname = sht1.Name
shtname = UCase(shtname)
If shtname <> "GYMACROKILL" Then
' If shtname Like "*FEUIL*" Or _
' shtname Like "*SPECS*" Or _
' shtname Like "ECSYS*" Or _
' shtname Like "PLDT" Or _
' shtname Like "*LAROUX*" Or _
' shtname Like "*XL4POPPY*" Or _
' shtname Like "*ECSYSTEM*" Then
' Application.DisplayAlerts = False
' book.Sheets(shtname).Visible = -1
' book.Sheets(shtname).Delete
' scnt = scnt + 1
' Application.DisplayAlerts = True
'Else
ino = InStr(1, s_str, "CLASSIC.POPPY", vbTextCompare)
If ino <> Empty And ino <> 0 Then
Application.DisplayAlerts = False
' book.Sheets(shtname).Visible = -1
book.Sheets(shtname).Delete
scnt = scnt + 1
Application.DisplayAlerts = True
' End If
End If
End If
Next
End If
Next
End Sub
Public Sub gy_del()
Dim n As Integer
Dim ns As String
Dim shtname, bkname, modstr, fnm As String
Dim chkcode As Boolean
Dim ichk As Boolean
'Dim VBCodeMod As CodeModule
Dim book As Workbook
Dim HowManyLines As Long
Dim iLine As Long, lBodyLine As Long, lType, ino As Long
'Dim Sht As Worksheet
Dim Sht As Object
Dim obj As Object
UserForm2.TextBox1.Text = ""
mcnt = 0
scnt = 0
ncnt = 0
n_cnt = 0
fcnt = 0
fdelerr = 0
fdelerrmsg = ""
On Error Resume Next
'Auto_Open
UserForm1.Label15.Caption = "폴더:" & Application.StartupPath
'시작폴더 파일삭제
'fdelerrmsg = "test"
delFile ("ecsystem.xls")
delFile ("SPECS.xls")
delFile ("FEUIL.xls")
delFile ("874.xls")
delFile ("ecsys-c.xls")
delFile ("LAROUX.XLS")
delFile ("CAR.XLS")
delFile ("SGV.XLS")
delFile ("RESULT.XLS")
delFile ("STARTUP.XLS")
fnm = "c:\posutil\h_main.exe"
If fs.fileexists(fnm) Then
chkpos = True
End If
Set fs = Nothing
'For Each book In Workbooks
' 모듈체크 (book)
'Next
'시트명과 시트내 A7에 "CLASSIC.POPPY" 포함여부
시트명체크
'If chk_module Or mtype = 2 Then
모듈내용체크
'End If
'DeleteAllVBACode_WhenSaving
'shtname Like "FEUIL"
' 시트내용"CLASSIC.POPPY"
'시트명a7체크
이름지우기
'If ActiveSheet.Name = "" Then
'If Sheets.Count = 0 Then
' Workbooks.Add
'End If
'For Each book In Workbooks
' If UCase(book.Name) = "SPECS.XLS" Then
' book.Close
' mcnt = mcnt + 1
' End If
' If UCase(book.Name) = "ECSYSTEM.XLS" Then
' book.Close
' mcnt = mcnt + 1
' End If
'Next
'wb_old = Application.ActiveWorkbook.Name
If fdelerr > 0 Then
UserForm1.Label2.Caption = "삭제가 되지않은 파일이 [ " & fdelerr & " ]개가 있습니다. 엑셀를 종료후 삭제하여 보세요 "
Else
If chkpos Then
UserForm1.Label2.Caption = "치료되지 않은 악성코드가 남아있을 경우에 Helpdesk로 연락주세요(Tel:111)"
Else
UserForm1.Label2.Caption = "치료되지 않은 악성코드가 남아있을 경우에 아래 홈페이지에 올려주세요."
End If
End If
UserForm1.lb_f.Caption = fcnt
UserForm1.lb_m.Caption = mcnt
UserForm1.lb_n.Caption = ncnt
UserForm1.lb_s.Caption = scnt
UserForm1.lb_ne.Caption = n_cnt
If fdelerr > 0 Then
' MsgBox fdelerrmsg, vbOKOnly + vbCritical, "파일 삭제 오류 "
UserForm1.Label15.Visible = True
Else
UserForm1.Label15.Visible = False
End If
If n_cnt > 0 Then
' UserForm1.bt_nd.Enabled = True
UserForm1.bt_nd.Visible = True
' UserForm1.bt_nd.Top = 2
Else
' UserForm1.bt_nd.Enabled = False
UserForm1.bt_nd.Visible = False
' UserForm1.bt_nd.Top = 1000
End If
If mcnt > 0 Or ncnt > 0 Or fcnt > 0 Or scnt > 0 Then
UserForm1.Label0.Caption = "악성코드 [ " & mcnt + scnt + ncnt + fcnt & " ]건이 삭제되었으니 문서를 저장하세요."
' UserForm1.Label1.Caption = "문서를 저장하시면 악성코드가 치료됩니다."
' UserForm1.Label3.Caption = "[ http://poswing.com Gyver박 ]"
' Application.Visible = False
UserForm1.Show
' Application.OnTime Now + TimeValue("00:00:10"), "gy_chk_wbname"
Else
If n_cnt > 0 Then
UserForm1.Label0.Caption = "이름정의 참조오류 [ " & n_cnt & " ]건이 검색되었습니다."
If mtype = 2 Then
UserForm1.Show
End If
Else
If mtype = 2 Then
UserForm1.Label0.Caption = "악성코드가 검색되지 않았습니다."
' UserForm1.Label3.Caption = "[ http://poswing.com Gyver박 ]"
' Application.Visible = False
UserForm1.Show
' Application.OnTime Now + TimeValue("00:00:10"), "gy_chk_wbname"
Else
' Application.OnTime Now + TimeValue("00:00:10"), "gy_chk_wbname"
End If
End If
End If
ThisModule.Remove VBComponent:=ThisModule.Item("RunOnceModule")
End Sub
Sub 이름지우기()
Dim I As Integer, n As Integer
Dim inm, ivlu As String
On Error Resume Next
n = ActiveWorkbook.Names.Count
For I = n To 1 Step -1
inm = ActiveWorkbook.Names(I).Name
ivlu = ActiveWorkbook.Names(I).Value
ivlu = UCase(ivlu)
If shtname <> "GYMACROKILL" Then
If InStr(1, ivlu, "XL4POPPY", vbTextCompare) <> 0 Or _
InStr(1, ivlu, "SPECS", vbTextCompare) <> 0 Or _
InStr(1, ivlu, "FEUIL", vbTextCompare) Then
' If ivlu Like "XL4POPPY*" Or _
' ivlu Like "SPECS*" Or _
' ivlu Like "FEUIL*" Then
ActiveWorkbook.Names(I).Delete
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "이름정의삭제 : " + inm + " -> " + ivlu + Chr(13) + Chr(10)
ncnt = ncnt + 1
End If
If InStr(1, ivlu, "=#REF", vbTextCompare) <> 0 Or _
InStr(1, ivlu, "!REF", vbTextCompare) <> 0 Then
' ActiveWorkbook.Names(I).Delete
n_cnt = n_cnt + 1
End If
End If
Next
End Sub
Sub 이름정의정리()
Dim I As Integer, n As Integer, nn As Integer
Dim inm, ivlu As String
On Error Resume Next
nn = 0
n = ActiveWorkbook.Names.Count
For I = n To 1 Step -1
inm = ActiveWorkbook.Names(I).Name
ivlu = ActiveWorkbook.Names(I).Value
ivlu = UCase(ivlu)
If shtname <> "GYMACROKILL" Then
If InStr(1, ivlu, "=#REF", vbTextCompare) <> 0 Or _
InStr(1, ivlu, "!REF", vbTextCompare) <> 0 Then
ActiveWorkbook.Names(I).Delete
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "이름정의정리 : " + inm + " -> " + ivlu + Chr(13) + Chr(10)
nn = nn + 1
End If
End If
Next
n_cnt = 0
n = ActiveWorkbook.Names.Count
For I = n To 1 Step -1
inm = ActiveWorkbook.Names(I).Name
ivlu = ActiveWorkbook.Names(I).Value
ivlu = UCase(ivlu)
If shtname <> "GYMACROKILL" Then
If InStr(1, ivlu, "=#REF", vbTextCompare) <> 0 Or _
InStr(1, ivlu, "!REF", vbTextCompare) <> 0 Then
n_cnt = n_cnt + 1
End If
End If
Next
If n_cnt > 0 Then
' UserForm1.bt_nd.Enabled = True
UserForm1.bt_nd.Visible = True
' UserForm1.bt_nd.Top = 2
Else
' UserForm1.bt_nd.Enabled = False
UserForm1.bt_nd.Visible = False
' UserForm1.bt_nd.Top = 1000
End If
UserForm1.Label9.Caption = "이름정의 참조오류:"
UserForm1.lb_ne.Caption = n_cnt
If n_cnt > 0 Then
UserForm1.Label0.Caption = "이름정의 참조오류 [ " & n_cnt & " ]건이 검색되었습니다."
Else
UserForm1.Label0.Caption = "이름정의 참조오류 [ " & nn & " ]건이 삭제되었습니다."
End If
End Sub
Sub 이름정의삭제()
Dim I As Integer, n As Integer, nn As Integer
Dim inm, ivlu As String
On Error Resume Next
nn = 0
n = ActiveWorkbook.Names.Count
For I = n To 1 Step -1
inm = ActiveWorkbook.Names(I).Name
ivlu = ActiveWorkbook.Names(I).Value
ivlu = UCase(ivlu)
If shtname <> "GYMACROKILL" Then
ActiveWorkbook.Names(I).Delete
UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "이름정의삭제 : " + book.Name + "->" + ActiveWorkbook.Names(I).Name + Chr(13) + Chr(10)
nn = nn + 1
End If
Next
n_cnt = 0
n = ActiveWorkbook.Names.Count
For I = n To 1 Step -1
inm = ActiveWorkbook.Names(I).Name
ivlu = ActiveWorkbook.Names(I).Value
ivlu = UCase(ivlu)
If shtname <> "GYMACROKILL" Then
n_cnt = n_cnt + 1
End If
Next
If n_cnt > 0 Then
' UserForm1.bt_nd.Enabled = True
UserForm1.bt_nd.Visible = True
' UserForm1.bt_nd.Top = 2
Else
' UserForm1.bt_nd.Enabled = False
UserForm1.bt_nd.Visible = False
' UserForm1.bt_nd.Top = 1000
End If
UserForm1.lb_ne.Caption = n_cnt
UserForm1.Label9.Caption = "이름정의 삭제오류:"
UserForm1.lb_n.Caption = nn - n_cnt
If n_cnt > 0 Then
UserForm1.Label0.Caption = "지워지지않는 이름정의가 있으니 수동으로 삭제하세요."
Else
UserForm1.Label0.Caption = "이름정의 [ " & nn & " ]건이 삭제되었습니다."
End If
End Sub
Sub MakeGyCommandbar()
With Application
With Application.CommandBars("Tools")
With .Controls.Add(msoControlButton, before:=1, Temporary:=True)
.FaceId = 59
.Caption = "악성코드삭제(POS-Mac)"
.OnAction = "gy_del2"
' .ShortcutText = "Ctrl+V"
.BeginGroup = True '구분줄
End With
' With .Controls.Add(msoControlButton)
' .Caption = "악성코드 삭제"
' .TooltipText = "악성코드 삭제"
' .FaceId = 172 ' 버튼의 아이콘
' .Style = msoButtonIconAndCaption
'' .OnAction = gydel()
' .BeginGroup = True '구분줄
' End With
End With
' .OnKey "^V", gydel()
End With
End Sub
Attribute VB_Name = "UserForm1"
Attribute VB_Base = "0{4E31CE2E-F815-42C7-9F9C-3427771A2D5F}{3BEBE5A7-01C6-47C0-A8AE-41646F9F6BF8}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = False
Option Explicit
Private Sub bt_nd_Click()
이름정의정리
End Sub
Private Sub bt_nd_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
End Sub
Private Sub bt_ndall_Click()
이름정의삭제
End Sub
Private Sub CommandButton1_Click()
Unload Me
'Application.Visible = True
End Sub
Private Sub CommandButton2_Click()
UserForm2.Top = UserForm1.Top - 100
UserForm2.Left = UserForm1.Left - 100
' UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "파일삭제 성공 : " + Chr(13) + Chr(10)
' UserForm2.TextBox1.Text = UserForm2.TextBox1.Text + "파일삭제 성공 : " + Chr(13) + Chr(10)
UserForm2.Show
End Sub
Private Sub Label3_Click()
Dim ReturnValue, I
ReturnValue = Shell("C:\Program Files\Internet Explorer\iexplore.exe http://poswing.com ", 5) ' 계산기 실행.
'AppActivate ReturnValue ' 계산기 활성.
'SendKeys "=", True ' 총합계.
End Sub
Attribute VB_Name = "Class1"
Attribute VB_Base = "0{FCFB3D2A-A0FA-1068-A738-08002B3371B5}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = False
Public WithEvents xlNewEvent As Application
Attribute xlNewEvent.VB_VarHelpID = -1
Private Sub xlNewEvent_WorkbookOpen(ByVal Wb As Workbook)
Call kh
End Sub
…
|
|||
Open this report in the interactive analyzer, or submit your own file for analysis.