Why is my vba macro working in debug f8 but not when running it it throws error when trying to cut a shaperange

I am trying to make a booklet imposition macro and it works when I press f8 multiple times it rearranges the pages by cutting and pasting but when I run the macro from scripts docker it stops at 3rd page when cutting please help

Parents
No Data
Reply
  • This usually happens because running with F8 gives CorelDRAW enough time to refresh objects between operations, while full-speed execution does not. If the ShapeRange changes after a cut/paste action, the reference can become invalid by the time the macro reaches the next page. Try adding a small delay with DoEvents after each cut/paste operation or reassign the ShapeRange object before using it again. In many VBA automation cases, timing and object refresh issues only appear when running at full speed.

Children
No Data