1) Resize your frame before running the macro.
2) Change Height and Width variables to take input instead of checking the existing frame size.
i was suggesting an option like we select the image, then go to fit elements so the image will come to the frame size. can we do it reverse? like bringing down the frame size from the selected image, that is the frame gets increase or decrease according to the selected image?
Thanks for your reply