ACCESS does not use, nor can it use, the EXCEL Analysis Toolpak addin.
The VBA code "Dim xlApp As Excel.Application" assumes that you have a
reference set to EXCEL library in ACCESS's reference list -- do you?

Signature
Ken Snell
<MS ACCESS MVP>
> Can you install "Analysis Toolpack - VBA" in Access? I use this in
> Excel, and now I'm trying to copy modules over to Access, and it's
[quoted text clipped - 3 lines]
>
> Thanks