Сначала установите вид страницы.
ActiveWindow.View = xlPageBreakPreview
Во-вторых, вам нужно иметь данные в любой ячейке, чтобы делать разрывы страниц.
.Range("a10000") = "d"
Затем поместите картинку в ячейку разрыва страницы.
Sub test()
'Resize all the pictures to fit the page while maintaining aspect ratio
Dim Ws As Worksheet
ActiveWindow.View = xlPageBreakPreview
With Application
.ScreenUpdating = False
Dim pict As Shape
Dim rngT As Range
'On Error Resume Next
For Each Ws In Worksheets
Ws.Range("a10000") = "d"
n = 0
For Each pict In Ws.Shapes
If pict.Type = msoPicture Or pict.Type = msoGraphic Or pict.Type = msoIgxGraphic And pict.Width > 1 And pict.Height > 1 Then
Ws.Activate
pict.LockAspectRatio = msoTrue
If n = 0 Then
Set rngT = Ws.Range("a1")
Else
Set rngT = Ws.HPageBreaks(n).Location
End If
With pict
.Top = rngT.Top
.Left = rngT.Left
.Height = 250
End With
n = n + 1
End If
Next pict
Ws.Range("a10000") = Empty
Next Ws
MsgBox n & " pictures were resized to fit the page successfully."
.ScreenUpdating = True
End With
End Sub