I found the solution.
Just before closing figure, set the window style to normal.
h=waitbar(0,'Please wait...','WindowStyle','modal');
.
.
.
set(h,'WindowStyle','normal');
close(h);
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!