Home > Software engineering >  Help: a great god, EXCEL, using VBA insert picture Shapes. The AddPicture, solve the image distortio
Help: a great god, EXCEL, using VBA insert picture Shapes. The AddPicture, solve the image distortio

Time:11-16

VBA to insert images to EXCEL in the cell, the distortion is severe, absolutely! God help me, how do you write the correct code
Private Sub CommandButton5_Click ()
Dim RNG, wj, I As an Integer

With the Application. The FileDialog (msoFileDialogFilePicker)
. The Title="choose picture"
If the Show Then
'get path
Wj=. SelectedItems (1)
End the If
End With

I=Sheets (" record ") Cells (Rows) Count, 1). The End (3). The row
The Set of RNG=Cells (I, 8)
ActiveSheet. Shapes. AddPicture (wj, True, True, RNG. Left, RNG. Top, RNG. The Width, the RNG. Height). The Placement=xlMoveAndSize
End Sub

Thank you very much!

CodePudding user response:

The building Lord paste pictures directly set the size, if not for natural distortion
  •  Tags:  
  • VBA