Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
protect / unprotect VBA project by macro sylvain Excel Discussion (Misc queries) 0 July 31st 06 06:09 PM
Referencing .Net Remoting Services project in MS Excel Macro Shilpa Excel Programming 0 April 10th 06 11:42 AM
VBA macro in Excel to control Project Mowbray Excel Programming 0 July 21st 05 06:48 PM
Triggering Excel Macro from MS-Project Buster Excel Programming 2 November 20th 04 11:35 AM
Excel Macro exporting to MS-Project 2002 No Name Excel Programming 0 June 2nd 04 06:59 PM


All times are GMT +1. The time now is 01:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"