|
Sub ShapeGroupSave2()
Dim Pic As Shape, i%, ActiveShape As Shape, UserSelection As Variant
With CreateObject("scripting.dictionary")
For Each Pic In Sheet1.Shapes
.Item(Right(Pic.BottomRightCell.Address, 1)) = Pic.Name & "@" & .Item(Right(Pic.BottomRightCell.Address, 1))
Next Pic
For i = 0 To .Count - 1
ActiveSheet.Shapes.Range(Split(Left(.items()(i), Len(.items()(i)) - 1), "@")).Select
Selection.ShapeRange.Align msoAlignCenters, msoFalse
Selection.ShapeRange.Group.Select
Set UserSelection = ActiveWindow.Selection
Set ActiveShape = ActiveSheet.Shapes(UserSelection.Name)
With ActiveSheet.ChartObjects.Add(Left:=ActiveCell.Left, Width:=ActiveShape.Width, Top:=ActiveCell.Top, Height:=ActiveShape.Height)
.ShapeRange.Fill.Visible = msoFalse
.ShapeRange.Line.Visible = msoFalse
ActiveShape.Copy
.Activate
ActiveChart.Paste
.Chart.Export ThisWorkbook.Path & "\" & Cells(i + 2, 3) & ".png"
.Delete
End With
Next i
End With
ActiveWorkbook.Close False
End Sub
|
|