Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect Excel VBA Project from another Excel Macro
Hi
I am opening a existing workbook using an excel macro and adding a module with some code and i am using send keys to protect the VBA project of the opened work book. But unfotunately it adds the password and protects the excel sheet which has the orginal macro. below is teh code iam using, can anybody suggest me a different solutions or modification sto the code Sub ProtectVBProject(WB As Workbook, ByVal Password As String) Dim vbProj As Object Set vbProj = WB.VBProject 'can't do it if already locked! If vbProj.Protection = 1 Then Exit Sub Set Application.VBE.ActiveVBProject = vbProj SendKeys "+{TAB}{RIGHT}%V{+}{TAB}" & Password & "{TAB}" & _ Password & "~" Application.VBE.CommandBars(1).FindControl(Id:=257 8, recursive:=True).Execute WB.Save End Sub Many thanks in advance Regards Ram |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
protect / unprotect VBA project by macro | Excel Discussion (Misc queries) | |||
Referencing .Net Remoting Services project in MS Excel Macro | Excel Programming | |||
VBA macro in Excel to control Project | Excel Programming | |||
Triggering Excel Macro from MS-Project | Excel Programming | |||
Excel Macro exporting to MS-Project 2002 | Excel Programming |