Within the *error* function, try changing:
(and rng (vlax-release-object rng))
(mapcar (function (lambda (obj) (and obj (vlax-release-object obj))))(list cell rng wBook xlApp))
(gc)
To:
(foreach obj (list cell rng wBook xlApp)
(and
(eq 'VLA-OBJECT (type obj))
(vl-catch-all-apply (function vlax-release-object) (list obj))
)
)
(gc)(gc)
also include this:
(vlax-invoke-method xlApp 'EnableEvents :vlax-false)
after creating the excel application object
(setq xlapp(vlax-get-or-create-object "Excel.Application"))