'解決改變Sheet1的圖片順序會造成"沒有使用權限"的錯誤
For Each Sp In Sheet1.Shapes
If Sp.Type = msoPicture Then
n = Sp.TopLeftCell.Offset(, -1)
Sp.Name = n & "Temp" '先把Picture物件的名子改掉避免對調後物件名子重複
End If
Next
For Each Sp In Sheet1.Shapes
If Sp.Type = msoPicture Then
n = Sp.TopLeftCell.Offset(, -1).Text
fs = ThisWorkbook.Path & "\" & n & ".jpg"
SaveAsPic Sp, fs
Sp.Name = n & ".jpg" '沒有使用權限
i = Sp.TopLeftCell.Row - 2
Obs(i).MyOpton.Caption = n
Image1.PictureSizeMode = 1
End If
Next