Microsoft-office 常见问题

1、工作表写入保护,忘记密码,解决办法:

流程如下:

1打开文件2工具---宏----录制新宏---输入名字如:aa3停止录制(这样得到一个空宏)4工具---宏----宏,选aa,点编辑按钮5删除窗口中的所有字符(只有几个),替换为下面的内容:

  1 Public Sub AllInternalPasswords()
  2 ‘ Breaks worksheet and workbook structure passwords. Bob McCormick
  3 ‘ probably originator of base code algorithm modified for coverage
  4 ‘ of workbook structure / windows passwords and for multiple passwords
  5 ‘
  6 ‘ Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)
  7 ‘ Modified 2003-Apr-04 by JEM: All msgs to constants, and
  8 ‘ eliminate one Exit Sub (Version 1.1.1)
  9 ‘ Reveals hashed passwords NOT original passwords
 10 Const DBLSPACE As String = vbNewLine & vbNewLine
 11 Const AUTHORS As String = DBLSPACE & vbNewLine & _
 12 "Adapted from Bob McCormick base code by" & _
 13 "Norman Harker and JE McGimpsey"
 14 Const HEADER As String = "AllInternalPasswords User Message"
 15 Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"
 16 Const REPBACK As String = DBLSPACE & "Please report failure " & _
 17 "to the microsoft.public.excel.programming newsgroup."
 18 Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _
 19 "now be free of all password protection, so make sure you:" & _
 20 DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _
 21 DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _
 22 DBLSPACE & "Also, remember that the password was " & _
 23 "put there for a reason. Don‘t stuff up crucial formulas " & _
 24 "or data." & DBLSPACE & "Access and use of some data " & _
 25 "may be an offense. If in doubt, don‘t."
 26 Const MSGNOPWORDS1 As String = "There were no passwords on " & _
 27 "sheets, or workbook structure or windows." & AUTHORS & VERSION
 28 Const MSGNOPWORDS2 As String = "There was no protection to " & _
 29 "workbook structure or windows." & DBLSPACE & _
 30 "Proceeding to unprotect sheets." & AUTHORS & VERSION
 31 Const MSGTAKETIME As String = "After pressing OK button this " & _
 32 "will take some time." & DBLSPACE & "Amount of time " & _
 33 "depends on how many different passwords, the " & _
 34 "passwords, and your computer‘s specification." & DBLSPACE & _
 35 "Just be patient! Make me a coffee!" & AUTHORS & VERSION
 36 Const MSGPWORDFOUND1 As String = "You had a Worksheet " & _
 37 "Structure or Windows Password set." & DBLSPACE & _
 38 "The password found was: " & DBLSPACE & "$$" & DBLSPACE & _
 39 "Note it down for potential future use in other workbooks by " & _
 40 "the same person who set this password." & DBLSPACE & _
 41 "Now to check and clear other passwords." & AUTHORS & VERSION
 42 Const MSGPWORDFOUND2 As String = "You had a Worksheet " & _
 43 "password set." & DBLSPACE & "The password found was: " & _
 44 DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _
 45 "future use in other workbooks by same person who " & _
 46 "set this password." & DBLSPACE & "Now to check and clear " & _
 47 "other passwords." & AUTHORS & VERSION
 48 Const MSGONLYONE As String = "Only structure / windows " & _
 49 "protected with the password that was just found." & _
 50 ALLCLEAR & AUTHORS & VERSION & REPBACK
 51 Dim w1 As Worksheet, w2 As Worksheet
 52 Dim i As Integer, j As Integer, k As Integer, l As Integer
 53 Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
 54 Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
 55 Dim PWord1 As String
 56 Dim ShTag As Boolean, WinTag As Boolean
 57 Application.ScreenUpdating = False
 58 With ActiveWorkbook
 59 WinTag = .ProtectStructure Or .ProtectWindows
 60 End With
 61 ShTag = False
 62 For Each w1 In Worksheets
 63 ShTag = ShTag Or w1.ProtectContents
 64 Next w1
 65 If Not ShTag And Not WinTag Then
 66 MsgBox MSGNOPWORDS1, vbInformation, HEADER
 67 Exit Sub
 68 End If
 69 MsgBox MSGTAKETIME, vbInformation, HEADER
 70 If Not WinTag Then
 71 MsgBox MSGNOPWORDS2, vbInformation, HEADER
 72 Else
 73 On Error Resume Next
 74 Do ‘dummy do loop
 75 For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
 76 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
 77 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
 78 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
 79 With ActiveWorkbook
 80 .Unprotect Chr(i) & Chr(j) & Chr(k) & _
 81 Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
 82 Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
 83 If .ProtectStructure = False And _
 84 .ProtectWindows = False Then
 85 PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
 86 Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
 87 Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
 88 MsgBox Application.Substitute(MSGPWORDFOUND1, _
 89 "$$", PWord1), vbInformation, HEADER
 90 Exit Do ‘Bypass all for...nexts
 91 End If
 92 End With
 93 Next: Next: Next: Next: Next: Next
 94 Next: Next: Next: Next: Next: Next
 95 Loop Until True
 96 On Error GoTo 0
 97 End If
 98 If WinTag And Not ShTag Then
 99 MsgBox MSGONLYONE, vbInformation, HEADER
100 Exit Sub
101 End If
102 On Error Resume Next
103 For Each w1 In Worksheets
104 ‘Attempt clearance with PWord1
105 w1.Unprotect PWord1
106 Next w1
107 On Error GoTo 0
108 ShTag = False
109 For Each w1 In Worksheets
110 ‘Checks for all clear ShTag triggered to 1 if not.
111 ShTag = ShTag Or w1.ProtectContents
112 Next w1
113 If ShTag Then
114 For Each w1 In Worksheets
115 With w1
116 If .ProtectContents Then
117 On Error Resume Next
118 Do ‘Dummy do loop
119 For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
120 For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
121 For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
122 For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
123 .Unprotect Chr(i) & Chr(j) & Chr(k) & _
124 Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
125 Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
126 If Not .ProtectContents Then
127 PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
128 Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
129 Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
130 MsgBox Application.Substitute(MSGPWORDFOUND2, _
131 "$$", PWord1), vbInformation, HEADER
132 ‘leverage finding Pword by trying on other sheets
133 For Each w2 In Worksheets
134 w2.Unprotect PWord1
135 Next w2
136 Exit Do ‘Bypass all for...nexts
137 End If
138 Next: Next: Next: Next: Next: Next
139 Next: Next: Next: Next: Next: Next
140 Loop Until True
141 On Error GoTo 0
142 End If
143 End With
144 Next w1
145 End If
146 MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER
147 End Sub

2、office2007怎样添加开发工具选项卡

        开发选项卡添加到工具栏

时间: 2024-10-26 11:13:05

Microsoft-office 常见问题的相关文章

IIS中使用Microsoft.Office.Interop.Excel 常见问题

IIS中使用Microsoft.Office.Interop.Excel 异常1: 检索 COM 类工厂中 CLSID 为 {00024500-0000-0000-C000-000000000046} 的组件时失 败,原因是出现以下错误: 80080005. 解决方案: A. 检查IIS发布的网站上的用户组有Administrators用户权限 B. 配置COM组件,用win+r命令打开命令运行窗口,输入Dcomcnfg命令,进入组件服务配置界面,找到“Microsoft Excel Appli

激活Microsoft Office professional plus 2010

1. 下载工具 http://pan.baidu.com/s/1dDDFhEL 2. 启动工具 双击Office 2010 Toolkit.exe 在Activation选项栏中选择AutoKMS Custom Task 在Main选项栏中选择Microsoft Office 2010,如下图 点击EZ-Activetor按钮 完成后如下, 如果在激活过程中失败,可重复以上动作,多试几次.

无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Word._Application”。

无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Word._Application”.此操作失败的原因是对 IID 为“{00020970-0000-0000-C000-000000000046}”的接口的 COM 组件调用 QueryInterface 因以下错误而失败: 加载类型库/DLL 时出错. (异常来自 HRESULT:0x80029C4A

Assembly 'Microsoft.Office.Interop.Excel

编译的时候报错,都无法通过编译: Assembly 'Microsoft.Office.Interop.Excel, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' uses 'Microsoft.Vbe.Interop, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' which has a higher version

解决“Microsoft Office Word遇到问题需要关闭”

有时候打开word文档,会遇到"Microsoft Office Word遇到问题需要关闭",这让我们很郁闷.怎么办呢? 打开"文件夹选项",选择"显示所有文件和文件夹". 进入C:\Documents and Settings\Administrator\Application Data\Microsoft\Templates,会看到2个文件. 选中这两个文件,删除. 重新打开word文档,这时候能打开了. 打开WORD时提示:"打印

错误 1 无法嵌入互操作类型“Microsoft.Office.Interop.Excel.ApplicationClass”。请改用适用的接口

http://www.cnblogs.com/waitingfor/archive/2011/12/19/2293469.html 错误 1 无法嵌入互操作类型"Microsoft.Office.Interop.Excel.ApplicationClass".请改用适用的接口,码迷,mamicode.com 错误 1 无法嵌入互操作类型"Microsoft.Office.Interop.Excel.ApplicationClass".请改用适用的接口

“未能从策略 Default Domain Policy 中删除应用程序 Microsoft Office Professional Plus 2010”错误解决

操作过程: 笔者通过组策略部署Office 2010时,由于部署方式不对,尽管在"软件部署"中删除了Office 2010,但启动计算机时,总提示"正在删除托管的Office 2010",同时日志文件中出现提示"未能从策略 Default Domain Policy 中删除应用程序 Microsoft Office Professional Plus 2010.错误为: %%1603". 解决方法: 通过Windows Installer Cle

Microsoft Office ->> 完整卸载Office 2007

今天用GHOST安装了Windows 8.1,结果发现预装了Office 2007,而且这个GHOST系统的Office 2007还不是很正规的安装手法安装的.它没有在注册表中注册.在打开控制面板后发现没有发现Microsoft Office 2007程序.因为我接着要安装Office 2013,而Office 2013和Office 2007不兼容,需要先卸载了Office 2007.网上找了很多方法完全卸载Office 2007的方法.这里贴上几个有用的链接: How to uninstal

引用Microsoft.Office.Interop.Excel出现的问题

引用Microsoft.Office.Interop.Excel出现的问题 转自:http://www.hccar.com/Content,2008,6,11,75.aspx,作者:方继祥 操作背景:asp.net操作Excel 出现问题:在本地添加引用(com):Microsoft Office 11.0 Object Library,并写好程序调试正常,部署到服务器时,出现异常 Excel.Application不是对象. 初步诊断:服务器没有安装Excel组件 第一步尝试解决:对服务器安装

报错:未能加载文件或程序集Microsoft.office.interop.excel,Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c”HRESULT:0x80131040

报错:未能加载文件或程序集Microsoft.office.interop.excel,Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c” 或它的某一个依赖项.找到的程序清单定义与程序集引用不匹配.异常来自HRESULT:0x80131040 WIN7环境.在装有2003的excel的XP导出成功 一直用office2010dll调试,不能导出excel 2003等旧版的. 把microsoft.office.C