是否可以从不同的文件VBA代码中保护vba代码?
我想写一个宏,为给定目录中的所有文件设置项目属性-保护-锁定项目以供查看:
manual example。
你好,Piotrek
//编辑
我试过了:
sub setVBAPassword(ws as Worksheet)
dim oVBP as VBProject
set oVBP = ws.VBProject
oVBP.VBE.CommandBars("Menu Bar").Controls("Tools") _
.Controls("VBAProject Properties...").Execute
With Application
.SendKeys "^{TAB}"
.SendKeys "{ }"
.SendKeys "{TAB}" & "test"
.SendKeys "{TAB}" & "test"
.SendKeys "{TAB}"
.SendKeys "{ENTER}"
End With
end sub问题是,它正在为运行宏的vb项目设置密码。问题是我如何切换到其他项目,或者如何在其他ws上下文中打开VBE?
发布于 2016-05-16 20:20:57
在Visual Studio中,转到Tools,然后转到“*Properties”(*=您的项目名称)。有一个保护选项卡。从那里应该很容易找到。
https://stackoverflow.com/questions/37253294
复制相似问题