yy豆包热舞视频:清除excel宏病毒startup.xls及解决excel弹出“系统内存不能为'write...

来源:百度文库 编辑:中财网 时间:2024/04/30 10:16:23

清除excel宏病毒startup.xls及解决excel弹出“系统内存不能为'write' or 'read'”的方法

现象:只要打开EXCEL文档时,系统就弹出“系统内存不能为 'write' or 'read'”的

系统提示

所中病毒:startup.xls宏病毒

解决方法:

    1.手工清除

        A、 搜索“startup.xls”文件,     搜索到后,直接删除,如不能删除的,那就在安全模式下删除;

       B、打开注册表,搜索“startup.xls”,搜索到后,直接删除;

      C、.在C:\Documents and Settings\administrator\Application Data\Microsoft\Excel\XLSTART\目录下,新建一个空白的startup.xls文件

以上三步做后,就可以解决弹出“系统内存不能为'write' or 'read'”的问题。

2.代码删除
              A、 搜索“startup.xls”文件,     搜索到后,直接删除,如不能删除的,那就在安全模式下删除;

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

 Sub auto_open()
On Error Resume Next
Application.ScreenUpdating = False
ActiveWindow.Visible = False
n$ = ActiveWorkbook.Name
Workbooks(n$).Close (False)
Application.OnSheetActivate = "StartUp.xls!cop"
End Sub
Sub cop()
On Error Resume Next
Dim VBC As Object
Dim Name As String
Dim delComponent As VBComponent
Name = "StartUp"
For Each book In Workbooks
Set delComponent = book.VBProject.VBComponents(Name)
book.VBProject.VBComponents.Remove delComponent
Next
End Sub
在保存文件时,报:Dim   b   As   VBComponent 编译错误“用户定义类型未定义”
解决方法:工具--引用--microsoft visual basic for applications extensibility 5.3 把它选上,就不会有编译错误了。至少这个库(vbIDE)里面有。