Chip Pearson wrote:
Rob,
For the Unprotect operation a much simpler way is simply use code
like the
following:
Sub UnprotectVBProject(WB As Workbook)
Set Application.VBE.ActiveProject = WB.VBProject
In Excel 10.0, this above does not select the project of an XLA addin
in the Projects window. Tried by running the UnprotectVBProject sub
routine from within VBE and also from excel Run macro dialog box but to
no avail. Also the Application.VBE.ActiveProject help file indicates
that this is now a readonly property. So, Microsoft now seems to have
permanently fixed the unlocking of VBE Projects via VBA! Right?
SendKeys "~PASSWORD~"
End Sub
Of course, change "PASSWORD" to the actual password for the project
(but keep
the leading and trailing ~ characters -- these represent the ENTER
key).
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com