Preventing compile errors when referencing objects ehanced after 1997
Matt,
Because of the fact that certain library components of Office and Windows can
become corrupt over time, it does indeed help to preface built-in function
calls
with a VBA. prefix. To expedite coding, what I do is to introduce the notation
(by dropping vowels) Lft( ), Rght( ), Md( ), Trm( ), etc., and then in the code
module define:
Function Lft(X as String, N as Integer)
Lft = VBA.Left(X, N)
End Function
And similarly for the other built-ins.
-- Dennis Eisen
|