Typical problem for me when overtaking a project that was recorded macros by a novice five years ago, and never set up VBE properly.
As usual, comments and suggestions welcomed
Spoiler
(Please be gentle!)
No Hans, I mistakenly thought that it was a project-level setting. Thank you for the correction.HansV wrote:Trusting access to the Visual Basic project is a user-level setting, not a project-level setting.
But perhaps ...
Quite so.Don Wells wrote:I think that it would be wise to add an error trap which appropriately advises the user, for those instances where the target project does not trust access to the Visual Basic Project.
To my mind it's the only way to go.Don Wells wrote:Embedding the test procedure within the function to be tested is a new one on me--providing a moment or three of confusion.
Code: Select all
Public Function strOnlyNOT(strIn As String, strRef As String) As String
End Function
Code: Select all
Public Function strOnlyNOT(strIn As String, strRef As String) As String
End Function
Sub TESTstrOnlyNOT()
Debug.Assert "lpht" = strOnlyNOT("alphabet", "abcde") ' regular use "aabe" of 1st string exist in 2nd string
Debug.Assert 0 = Len(strOnlyNOT("", "abcde")) ' empty source string yields empty result string, length = 0
Debug.Assert Len("alphabet") = Len(strOnlyNOT("alphabet", "")) ' empty reference string yields empty result string, length = 0
Debug.Assert "1" = strOnlyNOT("alphabetand1digit", "abcdefghijklmnopqrstuvwxyz") ' strip digit "1"
End Sub