devxlogo

Skip Object Declaration Using “With” Keyword

Skip Object Declaration Using “With” Keyword

If you want to use an object in the middle of a routine and avoid declaring the object in the routine, simply use this syntax:

 With New  	.End With

This is the equivalent of:

 Dim X as New With X	.End WithSet X = nothing

devx-admin

Share the Post: