excel中的VBA工程密碼破解方法

2022-06-05 18:33:05 字數 1526 閱讀 3929

1. 將對應的excel 另存為excel97-2003工作簿(*.xls),假設另存後的檔名為【目標.xls】

2.關閉 【目標.xls】檔案,一定要關閉

private

sub vbapassword() '

你要解保護的excel檔案路徑

excel檔案(*.xls & *.xla & *.xlt),*.xls;*.xla;*.xlt

", , "

vba破解")

ifdir(filename) = ""

then

msgbox

"沒找到相關檔案,清重新設定。

"exit sub

else

filecopy filename, filename & "

.bak"'

備份檔案。

endif

dim getdata as

string * 5

open filename

for binary as #1

dim cmgs as

long

dim dpbo as

long

for i = 1

tolof(1

)get #1

, i, getdata

if getdata = "

cmg=""

"then cmgs =i

if getdata = "

[host

"then dpbo = i - 2: exit

fornext

if cmgs = 0

then

msgbox

"請先對vba編碼設定乙個保護密碼...

", 32, "提示"

exit sub

endif

dim st as

string * 2

dim s20 as

string * 1

'取得乙個0d0a十六進製制字串

get #1, cmgs - 2

, st

'取得乙個20十六制字串

get #1, dpbo + 16

, s20

'替換加密部份機碼

for i = cmgs to dpbo step

2put #

1, i, st

next

'加入不配對符號

if (dpbo - cmgs) mod

2<> 0

then

put #

1, dpbo + 1

, s20

endif

msgbox

"檔案解密成功......

", 32, "提示"

close #

1end sub

3.執行上述**,會彈出檔案選擇框,選擇【目標.xls】檔案,等待一會兒,如果提示檔案解密成功,則破解成功。

4.關閉這個新建的excel檔案,去開啟【目標.xls】檔案,發現可以檢視excel的vba源**了

VBA 破解VBA工程密碼

sub vbapassword 你要解保護的excel檔案路徑 excel檔案 xls xla xlt xls xla xlt vba破解 ifdir filename then msgbox 沒找到相關檔案,清重新設定。exit sub else filecopy filename,filenam...

801 03 解鎖 VBA工程密碼

private sub vbapassword 你要解保護的excel檔案路徑 if dir filename then msgbox 沒找到相關檔案,清重新設定。exit sub else filecopy filename,filename bak 備份檔案。end if dim getdata...

在VBA中引用excel的函式

在 visual basic 語句中可以使用大多數 microsoft excel 工作表函式。若要檢視可以使用的工作表函式列表,請參閱 visual basic 可使用的工作表函式列表。注意 一些工作表函式在 visual basic 中是不實用的。例如 concatenate 函式就不實用,因為...