Step 1: Check the denominator.
The given integral is
\[
\int_{a-1}^{a}\frac{e^x(a-x)}{(x-a+1)^2}\,dx.
\]
At the lower limit,
\[
x=a-1.
\]
Then,
\[
x-a+1=(a-1)-a+1=0.
\]
So, the denominator becomes
\[
(x-a+1)^2=0.
\]
Step 2: Check the numerator at the same point.
At
\[
x=a-1,
\]
the numerator is
\[
e^{a-1}\{a-(a-1)\}=e^{a-1}.
\]
This is non-zero.
Therefore, the integrand becomes unbounded at
\[
x=a-1.
\]
Step 3: Use substitution to confirm divergence.
Let
\[
t=x-a+1.
\]
Then,
\[
x=a-1+t
\]
and
\[
a-x=1-t.
\]
When
\[
x=a-1,\quad t=0,
\]
and when
\[
x=a,\quad t=1.
\]
Thus, the integral becomes
\[
\int_0^1 \frac{e^{a-1+t}(1-t)}{t^2}\,dt.
\]
Near
\[
t=0,
\]
the integrand behaves like
\[
\frac{e^{a-1}}{t^2}.
\]
But
\[
\int_0^1 \frac{1}{t^2}\,dt
\]
is divergent.
Step 4: Final conclusion.
Hence, the printed integral does not have a finite value.
Therefore,
\[
\boxed{\text{The integral is divergent.}}
\]