<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post/2743/</link>
<title><![CDATA[如何撤销Excel工作表保护]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[WEB2.0]]></category>
<pubDate>Sun, 28 Feb 2010 13:41:14 +0000</pubDate> 
<guid>http://jackxiang.com/post/2743/</guid> 
<description>
<![CDATA[ 
	<br/>EXCEL工作表编辑资料，设置了工作表保护后，不能对表格进行插入删除操作。<br/>如果没有密码，很简单:工具-选项—工作表保护——撤消工作表保护 就可以了。<br/>如果忘记密码，如下操作：<br/>1&#92;打开文件<br/>2&#92;工具---宏----录制新宏---输入名字如:a<br/>3&#92;停止录制(这样得到一个空宏)<br/>4&#92;工具---宏----宏,选a,点编辑按钮<br/>5&#92;删除窗口中的所有字符(只有几个),替换为下面的内容:(复制下来)<br/><br/>Option Explicit<br/>Public Sub AllInternalPasswords()<br/>&#039; Breaks worksheet and workbook structure passwords. Bob McCormick<br/>&#039; probably originator of base code algorithm modified for coverage<br/>&#039; of workbook structure / windows passwords and for multiple passwords<br/>&#039;<br/>&#039; Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)<br/>&#039; Modified 2003-Apr-04 by JEM: All msgs to constants, and<br/>&#039; eliminate one Exit Sub (Version 1.1.1)<br/>&#039; Reveals hashed passwords NOT original passwords<br/>Const DBLSPACE As String = vbNewLine &amp; vbNewLine<br/>Const AUTHORS As String = DBLSPACE &amp; vbNewLine &amp; _<br/>&quot;Adapted from Bob McCormick base code by&quot; &amp; _<br/>&quot;Norman Harker and JE McGimpsey&quot;<br/>Const HEADER As String = &quot;AllInternalPasswords User Message&quot;<br/>Const VERSION As String = DBLSPACE &amp; &quot;Version 1.1.1 2003-Apr-04&quot;<br/>Const REPBACK As String = DBLSPACE &amp; &quot;Please report failure &quot; &amp; _<br/>&quot;to the microsoft.public.excel.programming newsgroup.&quot;<br/>Const ALLCLEAR As String = DBLSPACE &amp; &quot;The workbook should &quot; &amp; _<br/>&quot;now be free of all password protection, so make sure you:&quot; &amp; _<br/>DBLSPACE &amp; &quot;SAVE IT NOW!&quot; &amp; DBLSPACE &amp; &quot;and also&quot; &amp; _<br/>DBLSPACE &amp; &quot;BACKUP!, BACKUP!!, BACKUP!!!&quot; &amp; _<br/>DBLSPACE &amp; &quot;Also, remember that the password was &quot; &amp; _<br/>&quot;put there for a reason. Don&#039;t stuff up crucial formulas &quot; &amp; _<br/>&quot;or data.&quot; &amp; DBLSPACE &amp; &quot;Access and use of some data &quot; &amp; _<br/>&quot;may be an offense. If in doubt, don&#039;t.&quot;<br/>Const MSGNOPWORDS1 As String = &quot;There were no passwords on &quot; &amp; _<br/>&quot;sheets, or workbook structure or windows.&quot; &amp; AUTHORS &amp; VERSION<br/>Const MSGNOPWORDS2 As String = &quot;There was no protection to &quot; &amp; _<br/>&quot;workbook structure or windows.&quot; &amp; DBLSPACE &amp; _<br/>&quot;Proceeding to unprotect sheets.&quot; &amp; AUTHORS &amp; VERSION<br/>Const MSGTAKETIME As String = &quot;After pressing OK button this &quot; &amp; _<br/>&quot;will take some time.&quot; &amp; DBLSPACE &amp; &quot;Amount of time &quot; &amp; _<br/>&quot;depends on how many different passwords, the &quot; &amp; _<br/>&quot;passwords, and your computer&#039;s specification.&quot; &amp; DBLSPACE &amp; _<br/>&quot;Just be patient! Make me a coffee!&quot; &amp; AUTHORS &amp; VERSION<br/>Const MSGPWORDFOUND1 As String = &quot;You had a Worksheet &quot; &amp; _<br/>&quot;Structure or Windows Password set.&quot; &amp; DBLSPACE &amp; _<br/>&quot;The password found was: &quot; &amp; DBLSPACE &amp; &quot;$$&quot; &amp; DBLSPACE &amp; _<br/>&quot;Note it down for potential future use in other workbooks by &quot; &amp; _<br/>&quot;the same person who set this password.&quot; &amp; DBLSPACE &amp; _<br/>&quot;Now to check and clear other passwords.&quot; &amp; AUTHORS &amp; VERSION<br/>Const MSGPWORDFOUND2 As String = &quot;You had a Worksheet &quot; &amp; _<br/>&quot;password set.&quot; &amp; DBLSPACE &amp; &quot;The password found was: &quot; &amp; _<br/>DBLSPACE &amp; &quot;$$&quot; &amp; DBLSPACE &amp; &quot;Note it down for potential &quot; &amp; _<br/>&quot;future use in other workbooks by same person who &quot; &amp; _<br/>&quot;set this password.&quot; &amp; DBLSPACE &amp; &quot;Now to check and clear &quot; &amp; _<br/>&quot;other passwords.&quot; &amp; AUTHORS &amp; VERSION<br/>Const MSGONLYONE As String = &quot;Only structure / windows &quot; &amp; _<br/>&quot;protected with the password that was just found.&quot; &amp; _<br/>ALLCLEAR &amp; AUTHORS &amp; VERSION &amp; REPBACK<br/>Dim w1 As Worksheet, w2 As Worksheet<br/>Dim i As Integer, j As Integer, k As Integer, l As Integer<br/>Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer<br/>Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer<br/>Dim PWord1 As String<br/>Dim ShTag As Boolean, WinTag As Boolean<br/>Application.ScreenUpdating = False<br/>With ActiveWorkbook<br/>WinTag = .ProtectStructure Or .ProtectWindows<br/>End With<br/>ShTag = False<br/>For Each w1 In Worksheets<br/>ShTag = ShTag Or w1.ProtectContents<br/>Next w1<br/>If Not ShTag And Not WinTag Then<br/>MsgBox MSGNOPWORDS1, vbInformation, HEADER<br/>Exit Sub<br/>End If<br/>MsgBox MSGTAKETIME, vbInformation, HEADER<br/>If Not WinTag Then<br/>MsgBox MSGNOPWORDS2, vbInformation, HEADER<br/>Else<br/>On Error Resume Next<br/>Do &#039;dummy do loop<br/>For i = 65 To 66: For j = 65 To 66: For k = 65 To 66<br/>For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66<br/>For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66<br/>For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126<br/>With ActiveWorkbook<br/>.Unprotect Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; _<br/>Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; _<br/>Chr(i3) &amp; Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)<br/>If .ProtectStructure = False And _<br/>.ProtectWindows = False Then<br/>PWord1 = Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; Chr(l) &amp; _<br/>Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _<br/>Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)<br/>MsgBox Application.Substitute(MSGPWORDFOUND1, _<br/>&quot;$$&quot;, PWord1), vbInformation, HEADER<br/>Exit Do &#039;Bypass all for...nexts<br/>End If<br/>End With<br/>Next: Next: Next: Next: Next: Next<br/>Next: Next: Next: Next: Next: Next<br/>Loop Until True<br/>On Error GoTo 0<br/>End If<br/>If WinTag And Not ShTag Then<br/>MsgBox MSGONLYONE, vbInformation, HEADER<br/>Exit Sub<br/>End If<br/>On Error Resume Next<br/>For Each w1 In Worksheets<br/>&#039;Attempt clearance with PWord1<br/>w1.Unprotect PWord1<br/>Next w1<br/>On Error GoTo 0<br/>ShTag = False<br/>For Each w1 In Worksheets<br/>&#039;Checks for all clear ShTag triggered to 1 if not.<br/>ShTag = ShTag Or w1.ProtectContents<br/>Next w1<br/>If ShTag Then<br/>For Each w1 In Worksheets<br/>With w1<br/>If .ProtectContents Then<br/>On Error Resume Next<br/>Do &#039;Dummy do loop<br/>For i = 65 To 66: For j = 65 To 66: For k = 65 To 66<br/>For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66<br/>For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66<br/>For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126<br/>.Unprotect Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; _<br/>Chr(l) &amp; Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _<br/>Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)<br/>If Not .ProtectContents Then<br/>PWord1 = Chr(i) &amp; Chr(j) &amp; Chr(k) &amp; Chr(l) &amp; _<br/>Chr(m) &amp; Chr(i1) &amp; Chr(i2) &amp; Chr(i3) &amp; _<br/>Chr(i4) &amp; Chr(i5) &amp; Chr(i6) &amp; Chr(n)<br/>MsgBox Application.Substitute(MSGPWORDFOUND2, _<br/>&quot;$$&quot;, PWord1), vbInformation, HEADER<br/>&#039;leverage finding Pword by trying on other sheets<br/>For Each w2 In Worksheets<br/>w2.Unprotect PWord1<br/>Next w2<br/>Exit Do &#039;Bypass all for...nexts<br/>End If<br/>Next: Next: Next: Next: Next: Next<br/>Next: Next: Next: Next: Next: Next<br/>Loop Until True<br/>On Error GoTo 0<br/>End If<br/>End With<br/>Next w1<br/>End If<br/>MsgBox ALLCLEAR &amp; AUTHORS &amp; VERSION &amp; REPBACK, vbInformation, HEADER<br/>End Sub<br/>6&#92;关闭编辑窗口<br/>7&#92;工具---宏-----宏,选AllInternalPasswords,运行,确定两次,等2分钟(确实有这么长时间),再确定.<br/>OK,没有密码了!!
]]>
</description>
</item><item>
<link>http://jackxiang.com/post/2743/#blogcomment51532</link>
<title><![CDATA[[评论] 如何撤销Excel工作表保护]]></title> 
<author>夜幕 &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Mon, 01 Mar 2010 08:58:22 +0000</pubDate> 
<guid>http://jackxiang.com/post/2743/#blogcomment51532</guid> 
<description>
<![CDATA[ 
	楼主太好了，解决了我的大问题呀！太实用了，顶顶顶！
]]>
</description>
</item>
</channel>
</rss>