VBA ดึงรูปแล้วภาพเบลอ
Posted: Tue Feb 23, 2016 8:58 am
ผมลอง Reset Size รูปที่ถูกเพิ่มเข้ามาดูปรากฎว่า Reset Size ไม่ได้ ทำให้เวลาขยายภาพขึ้นมันจะเบลอ..
เป็นเรื่องปรกติของการใช้ VBA ดึงรูปเข้ามารึเปล่าวครับ รึว่าเป็นที่ Code
Code: Select all
Sub picture_Q5()
Dim sFile As Variant, r As Range
Dim imgIcon As Object
Set r = Range("Q5").MergeArea
sFile = Application.GetOpenFilename(FileFilter:="Pic Files (*.jpg;*.bmp), *.jpg;*.bmp", _
Title:="Browse to select a picture")
If sFile = False Then Exit Sub
Set imgIcon = ActiveSheet.Shapes.AddPicture( _
Filename:=sFile, _
LinkToFile:=False, _
SaveWithDocument:=msoCTrue, _
Left:=r.Left, _
Top:=r.Top, _
Width:=r.Width, _
Height:=r.Height)
End Sub