Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default This request for the very experts. Please reply at the earliest

here is a programme I found on net. I want to modify this programme so that
the project itself becomes unviewable. I can bet that I had one code before
which I have misplaced . That four to five liner use to just shut down the
project.


here sis the code found from net. It is not mine. I am not capable of such
sophisticated coding as of now. Thank you

Option Explicit

Const BreakIt As String = "%{F11}%TE+{TAB}{RIGHT}%V{+}{TAB}"

Sub Change_VBA_PW()
Dim WB As Workbook
Dim Password As String

Set WB = ActiveWorkbook
Password = "test"
Call SetVBProjectPassword(WB, Password)

End Sub

Sub SetVBProjectPassword(WB As Workbook, ByVal Password As String)
'Needs reference to Visual Basic for Applications Extensibility Library
Dim VBP As VBProject, openWin As VBIDE.Window
Dim wbActive As Workbook
Dim i As Integer

Set VBP = WB.VBProject
Set wbActive = ActiveWorkbook


Application.ScreenUpdating = False

' close any code windows to ensure we hit the right project
For Each openWin In VBP.VBE.Windows
If InStr(openWin.Caption, "(") 0 Then openWin.Close
Next oWin

WB.Activate

Application.OnKey "%{F11}"
SendKeys BreakIt & Password & "{tab}" & Password & "~%{F11}", True
Application.ScreenUpdating = True
wbActive.Activate
End Sub


The idea is to make this programme close all the modules and "do not ask for
a password"


Please help .
Thank you very much.
--
beetal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Jarek can you and other MS profs This request for the very experts


--
beetal


"BEETAL" wrote:

here is a programme I found on net. I want to modify this programme so that
the project itself becomes unviewable. I can bet that I had one code before
which I have misplaced . That four to five liner use to just shut down the
project.


here sis the code found from net. It is not mine. I am not capable of such
sophisticated coding as of now. Thank you

Option Explicit

Const BreakIt As String = "%{F11}%TE+{TAB}{RIGHT}%V{+}{TAB}"

Sub Change_VBA_PW()
Dim WB As Workbook
Dim Password As String

Set WB = ActiveWorkbook
Password = "test"
Call SetVBProjectPassword(WB, Password)

End Sub

Sub SetVBProjectPassword(WB As Workbook, ByVal Password As String)
'Needs reference to Visual Basic for Applications Extensibility Library
Dim VBP As VBProject, openWin As VBIDE.Window
Dim wbActive As Workbook
Dim i As Integer

Set VBP = WB.VBProject
Set wbActive = ActiveWorkbook


Application.ScreenUpdating = False

' close any code windows to ensure we hit the right project
For Each openWin In VBP.VBE.Windows
If InStr(openWin.Caption, "(") 0 Then openWin.Close
Next oWin

WB.Activate

Application.OnKey "%{F11}"
SendKeys BreakIt & Password & "{tab}" & Password & "~%{F11}", True
Application.ScreenUpdating = True
wbActive.Activate
End Sub


The idea is to make this programme close all the modules and "do not ask for
a password"


Please help .
Thank you very much.
--
beetal

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
Need Help at the earliest in Pie charts Shiva Charts and Charting in Excel 1 April 20th 09 05:24 PM
Earliest date using WEEKNUMBER Jock Excel Worksheet Functions 3 September 17th 07 10:17 AM
Msgbox experts please reply.. sally Excel Worksheet Functions 8 April 20th 06 10:26 PM
Flag Earliest Dup Steph[_3_] Excel Programming 1 October 14th 04 06:13 AM
Use only VBA - request for experts Mark[_17_] Excel Programming 2 October 21st 03 10:23 AM


All times are GMT +1. The time now is 11:31 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"