如何同时删除多个excel表中的图片?
展开全部
Sub File_Form()
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Excel File", "*.xls*"
If .Show = -1 Then
Dim i As Integer
Dim wk As Workbook
Dim sp As Shape
For i = 1 To .SelectedItems.Count
Debug.Print .SelectedItems(i)
Set wk = Workbooks.Open(.SelectedItems(i))
For Each sp In wk.Worksheets(1).Shapes
sp.Delete
Next sh
wk.Close True
Next i
End If
End With
End Sub
With Application.FileDialog(msoFileDialogFilePicker)
.AllowMultiSelect = True
.Filters.Clear
.Filters.Add "Excel File", "*.xls*"
If .Show = -1 Then
Dim i As Integer
Dim wk As Workbook
Dim sp As Shape
For i = 1 To .SelectedItems.Count
Debug.Print .SelectedItems(i)
Set wk = Workbooks.Open(.SelectedItems(i))
For Each sp In wk.Worksheets(1).Shapes
sp.Delete
Next sh
wk.Close True
Next i
End If
End With
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |