Guest User

Untitled

a guest
May 21st, 2018
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Attribute VB_Name = "Module1"
  2. Sub get_image_path_and_current_cell()
  3. Dim pic As Shape, TCht As Object
  4. Dim ACWidth As Long, ACHeight As Long
  5. For Each pic In ActiveSheet.Shapes
  6. Debug.Print (pic.AlternativeText)
  7. Range(pic.TopLeftCell.Address).Offset(0, 1) = pic.AlternativeText
  8. ACWidth = pic.Width
  9. ACHeight = pic.Height
  10. TCht.Paste
  11. TCht.Export Filename:=ThisWorkbook.Path & "\new_pic\" & pic.AlternativeText, filtername:="PNG"
  12. TCht.Parent.Delete
  13. Debug.Print (pic.TopLeftCell.Address)
  14. Next
  15. End Sub
Add Comment
Please, Sign In to add comment