The effect of pellets on the global magnetohydrodynamic (MHD) dynamics of the Large Helical Device (LHD), which is a large superconducting heliotron in Japan, has been analyzed with the MIPS code. A pellet ablation model based on the neutral gas shielding model has been implemented. Excitation of MHD modes by the three-dimensionally localized pressure perturbation caused by the pellet injection has been observed. The dependence of the MHD-instabilities on the pellet size has been analyzed.