八亿电脑网
游戏盒子
当前位置: 首页 > Office之家 > Excel教程 >

Excel表格保护密码忘了如何办

时间:2016-10-10 12:51来源:网络 作者:win8e 点击:
游戏盒子

  打开受密码保护的工作表

八亿电脑网

  工具---宏----录制新宏---输入名字如:hh

八亿电脑网

  停止录制(这样得到一个空宏)

八亿电脑网

  工具---宏----宏,选hh,点编辑按钮

八亿电脑网

  删除窗口中的所有字符,替换为下面的内容:

  Public Sub AllInternalPassWords()

  ' Breaks worksheet and workbook structure passWords. Bob McCormick

  ' probably originator of base code algorithm modifIEd for coverage

  ' of workbook structure / windows passWords and for multiple passWords

  '

  ' Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)

  ' ModifIEd 2003-Apr-04 by JEM: All msgs to constants, and

  ' eliminate one Exit Sub (Version 1.1.1)

  ' Reveals hashed passWords NOT original passWords

  Const DBLSPACE As String = vbNewLine & vbNewLine

  Const AUTHORS As String = DBLSPACE & vbNewLine & _

  "Adapted from Bob McCormick base code by" & _

  "Norman Harker and JE McGimpsey"

  Const HEADER As String = "AllInternalPassWords User Message"

  Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"

  Const REPBACK As String = DBLSPACE & "Please report failure " & _

  "to the microsoft.public.Excel.programming newsgroup."

  Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _

  "now be free of all passWord protection, so make sure you:" & _

  DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _

  DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _

  DBLSPACE & "Also, remember that the passWord was " & _

  "put there for a reason. Don't stuff up crucial formulas " & _

  "or data." & DBLSPACE & "Access and use of some data " & _

  "may be an offense. If in doubt, don't."

  Const MSGNOPWordS1 As String = "There were no passWords on " & _

  "sheets, or workbook structure or windows." & AUTHORS & VERSION

  Const MSGNOPWordS2 As String = "There was no protection to " & _

  "workbook structure or windows." & DBLSPACE & _

  "Proceeding to unprotect sheets." & AUTHORS & VERSION

  Const MSGTAKETIME As String = "After pressing OK button this " & _

  "will take some time." & DBLSPACE & "Amount of time " & _

  "depends on how many different passWords, the " & _

  "passWords, and your computer's specification." & DBLSPACE & _

  "Just be patIEnt! Make me a coffee!" & AUTHORS & VERSION

  Const MSGPWordFOUND1 As String = "You had a Worksheet " & _

  "Structure or Windows PassWord set." & DBLSPACE & _

  "The passWord found was: " & DBLSPACE & "" & DBLSPACE & _

  "Note it down for potential future use in other workbooks by " & _

  "the same person who set this passWord." & DBLSPACE & _

  "Now to check and clear other passWords." & AUTHORS & VERSION

  Const MSGPWordFOUND2 As String = "You had a Worksheet " & _

  "passWord set." & DBLSPACE & "The passWord found was: " & _

  DBLSPACE & "" & DBLSPACE & "Note it down for potential " & _

  "future use in other workbooks by same person who " & _

  "set this passWord." & DBLSPACE & "Now to check and clear " & _

  "other passWords." & AUTHORS & VERSION

  Const MSGONLYONE As String = "Only structure / windows " & _

  "protected with the passWord that was just found." & _

  ALLCLEAR & AUTHORS & VERSION & REPBACK

  Dim w1 As Worksheet, w2 As Worksheet

  Dim i As Integer, j As Integer, k As Integer, l As Integer

  Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer

  Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer

发表评论
热点文章