Trefor,
Here's a little routine I run prior to running any macros that require the
Trusted VBA Setting. Just checks to make sure the setting is correct before
even starting. In my case, the macro ran for sometimes 15 minutes before it
finally crashed so it's good to test setting first.
Private Sub Check_Trusted_VBA()
Dim trustMe, trustMess
trustMe = VBAIsTrusted
If trustMe = False Then
trustMess = "PRIOR TO RUNNING THIS UTILITY" & Chr(10)
trustMess = trustMess & " You need to adjust your Macro Security
Settings as shown below:" & Chr(10) & Chr(10)
trustMess = trustMess & "Click on Excel Menu: Tools > Macro >
Security" & Chr(10)
trustMess = trustMess & "Then Click on 'Trusted Publishers' Tab" & Chr(10)
trustMess = trustMess & "'Check' the 2nd box: 'Trust Access to Visual
Basic Project'" & Chr(10)
trustMess = trustMess & "Then 'Save' this File and Re-Run the Utility."
& Chr(10)
trustMess = trustMess & Chr(10)
trustMess = trustMess & "By doing this, you are allowing this utility to
copy macros" & Chr(10)
trustMess = trustMess & "to the Newly created Workbook which are needed
for it to work." & Chr(10)
trustMess = trustMess & Chr(10)
trustMess = trustMess & "Most Macros don't need this feature to work,
but this one does." & Chr(10)
trustMess = trustMess & "After running this macro, you can always
'Uncheck' that box if you have security concerns." & Chr(10)
trustMe = MsgBox(trustMess, vbCritical)
End
End If
End Sub
Trefor said:
Dave,
Is there a way to do this without getting an error and to sucessfully copy a
Form from a password protected project to a new workbook?