adding vbam code AS-IS from sourceforce.