S
Sarah (OGI)
I'm getting a type mismatch error, at the point of 'For Each pic In
wsSource.Pictures' in the following code - any ideas why this might be?
=============
Sub CopyAllPictures()
Dim r As Long, c As Long
Dim wsSource As Worksheet
Dim wsDest As Worksheet
Dim pic As Picture
Set wsSource = Workbooks("test.xls").Worksheets("Summary")
Set wsDest = Worksheets("PC (Chart)-NI-MONTH")
r = wsSource.Rows.Count
c = wsSource.Columns.Count
For Each pic In wsSource.Pictures
With pic.TopLeftCell
If .Row < r Then r = .Row
If .Column < c Then c = .Column
End With
Next
wsDest.Activate
wsDest.Cells(r, c).Activate
wsSource.Pictures.Copy
wsDest.Paste
wsDest.Cells(r, c).Activate
End Sub
============
wsSource.Pictures' in the following code - any ideas why this might be?
=============
Sub CopyAllPictures()
Dim r As Long, c As Long
Dim wsSource As Worksheet
Dim wsDest As Worksheet
Dim pic As Picture
Set wsSource = Workbooks("test.xls").Worksheets("Summary")
Set wsDest = Worksheets("PC (Chart)-NI-MONTH")
r = wsSource.Rows.Count
c = wsSource.Columns.Count
For Each pic In wsSource.Pictures
With pic.TopLeftCell
If .Row < r Then r = .Row
If .Column < c Then c = .Column
End With
Next
wsDest.Activate
wsDest.Cells(r, c).Activate
wsSource.Pictures.Copy
wsDest.Paste
wsDest.Cells(r, c).Activate
End Sub
============