QQ空间 新浪微博 腾讯微博 人人网 更多 技术资料谨慎模仿操作,操作不挡后果自负
当前位置:首页 »办公自动化»office»StartUp.xls宏病毒清除方法及步骤
StartUp.xls宏病毒清除方法及步骤
[导读]

第一步:清除C:\Documents and Settings\administrator\Application Data\Microsoft\Excel\XLSTART下的StartUp.xls;

第二步:清除C:\Documents and Settings\administrator\Application Data\Microsoft\Excel\的Excel11.exe(约236K),Excel程序会自建该文件。

第三步:新建\Documents and Settings\administrator\Application Data\Microsoft\Excel\XLSTART\startup.xls文件,输入以下代码就行了,以后再打开带毒的excel文件就会自动清除excel文件自带的病毒宏代码了

Sub auto_open()
Dim FS As Object
Dim BK As Workbook
Dim SHT As Worksheet
Dim ifExist As Boolean

On Error Resume Next
'判断是否存在StartUp,以ifExist标记
ifExist = False
If Dir(Application.StartupPath & "\" & "StartUp.xls") <> "" Then ifExist = True
If ifExist = False Then
For Each BK In Workbooks
If ifExist Then Exit For
For Each SHT In BK.Sheets
If ifExist Then Exit For
If BK.Sheets("StartUp").Name <> "StartUp" Then
ifExist = False
Else
ifExist = True
End If
Next SHT
Next BK
End If

'判断是否清除StartUp
If ifExist Then
If MsgBox("发现StartUp!" & vbCrLf & "StartUp可能影响你的Excel!是否清除?", vbOKCancel) = vbCancel Then Exit Sub
Else
MsgBox "未发现StartUp,自动退出"
ThisWorkbook.Close
Exit Sub
End If

'关闭StartUp.xls
Workbooks("StartUp.xls").Close False
'删除文件
Set FS = CreateObject("Scripting.FileSystemObject")
FS.DeleteFile Application.StartupPath & "\" & "StartUp.xls"
'删除宏模块StartUp
Application.DisplayAlerts = False
For Each BK In Workbooks
BK.Sheets("StartUp").Delete
Next BK
Application.DisplayAlerts = True
'恢复变量
Application.OnSheetActivate = ""
Application.OnKey "%{F11}"
Application.OnKey "%{F8}"
MsgBox "清除StartUp完毕,自动退出!"
ThisWorkbook.Close
End Sub

  • 上一篇:
  • 下一篇:
  • 【免责声明:本站所发表的文章,大部分来源于各相关媒体或者网络,内容仅供参阅,与本站立场无关。如有不符合事实,或影响到您利益的文章,请及时告知,本站立即删除。谢谢监督。】
    资讯搜索
  •   
  • 苏州电脑维修 网络维护
  • 15851499111 65581585
  • 推荐资讯
  • 一、.
  • 二、
  • 三、
  • 四、
  • 五、
  • 六、
  • 七、
  • 八、
  • 九、
  • 十、..
  • 图片资讯
    相关资讯
  • 一、.
  • 二、
  • 三、
  • 四、
  • 五、
  • 六、
  • 七、
  • 八、
  • 九、
  • 十、..