Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need Help at the earliest in Pie charts | Charts and Charting in Excel | |||
Earliest date using WEEKNUMBER | Excel Worksheet Functions | |||
Msgbox experts please reply.. | Excel Worksheet Functions | |||
Flag Earliest Dup | Excel Programming | |||
Use only VBA - request for experts | Excel Programming |