Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
Function GetModuleWorkbook() As Workbook Const cstrWORKBOOK_PATH As String = "C:\Netserver\oztech_dev_oz\oz_excel\" Const cstrWORKBOOK_NAME As String = "oz_main.xls" Dim wbk As Workbook On Error Resume Next Set wbk = Workbooks(cstrWORKBOOK_NAME) If wbk Is Nothing Then Dim secAutomation As MsoAutomationSecurity secAutomation = Application.AutomationSecurity Application.AutomationSecurity = msoAutomationSecurityForceDisable If UnprotectVBProject(wbk, "fYb42248Z9") Then Set wbk = Workbooks.Open(cstrWORKBOOK_PATH & cstrWORKBOOK_NAME, , ReadOnly:=True, Password:="fYb42248Z9", IgnoreReadOnlyRecommended:=True) End If End If Set GetModuleWorkbook = wbk End Function Sub UnprotectVBProject(ByRef objWorkbook As Workbook, ByVal strPassword As String) Set Application.VBE.ActiveVBProject = objWorkbook.VBProject SendKeys "~" & strPassword & "~" End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.