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
This usually happens because running with F8 (step-by-step) gives VBA time to refresh the document and update the ShapeRange selection, while running normally is too fast and the shape/object reference becomes invalid after a cut or paste. After you cut a shape, the original ShapeRange may no longer exist, so the next line fails. Try avoiding .Select and Selection.ShapeRange, store the shape in an object variable instead, and add a small DoEvents or short delay after cut/paste operations. Also loop backwards when moving pages/shapes because indexes change after each cut.
ShapeRange
.Select
Selection.ShapeRange
DoEvents