View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Resizing of picture different in run time and design time

the problem probably isn't in the loop you posted. I would need to see the
entire code to spot the problem. You are probably get the the szie from the
wrong source location. Probably from a different worksheet.

"Broadband-Al" wrote:

Very odd. I have a simple macro to resize all the pictures on a page in
order to fit the page breaks. It works perfectly when I step through the
code, line by line using "F8" but if I leave it to run from a command button
on the sheet, the pictures do resize but to a completely different dimension
than instructed.

After resetting pagebreaks, the code is simply a for next loop with:

AcvtiveSheet.Shapes(i).Select
With Selection
.ShapeRange.LockAspectRatio = msoTrue
.ShapeRange.Height = ht
.ShapeRange.Top = yposn
.ShapeRange.Left = xposn
End With