Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
We are trying to push some new code to the our code modules in a workbook.
The issue we face right now is that the modules are protected. Is there a way to programmatically remove the module protection. So that I can run the bellow code so that I do not get an error accessing the protected modules. Sub PatchWorkbook(PatchWBPath As String) Dim ve As VBE Dim xl As Excel.Application Dim wb As Workbook Dim codeModule As codeModule Set xl = New Excel.Application xl.EnableEvents = False xl.DisplayAlerts = False Set wb = xl.Workbooks.Open(PatchWBPath, False, False, , "", "", , , , , False) wb.UpdateRemoteReferences = False xl.Calculation = xlCalculationManual Set ve = xl.VBE Debug.Print ve.VBProjects(1).Protection Set codeModule = ve.ActiveVBProject.VBComponents("ThisWorkbook") wb.Save wb.Close Set wb = Nothing Set xl = Nothing End Sub Thanks in advance! Reg, Adam |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Difference in the listing of the New module addition in 2002 version | Excel Discussion (Misc queries) | |||
General protection fault in module HPPCL5F4.DLL at 0002:000006c2. | Excel Discussion (Misc queries) | |||
Access Module coded converted to Excel Function | Excel Discussion (Misc queries) | |||
EXCELL Protection | Excel Discussion (Misc queries) | |||
How may I remove Office 2003 DRM protection from DOC & XLS files? | Excel Discussion (Misc queries) |