D
Dan Kelly
I'm having a problem copying an image embedded on a template into a second
workbook. The image "Picture 1" is on a template called "Test.xlt". It is
copied to a tab called "Blank" in the main workbook and then onto all
subsequent tabs.
The first part of the following code works - copying the image from the
template to blank and repositioning the image. The problem occurs after
copying the image from Blank to the next tab. Each tab is activated in order
and unprotected prior to this call:
If ActiveSheet.Name = "Blank" Then
' This all works
Workbooks.Open FileName:="Test.xlt"
ActiveSheet.Shapes("Picture 1").Select
Selection.Copy
ActiveWindow.Close
Sheets("Blank").Activate
ActiveSheet.Unprotect
ActiveSheet.Paste
Else
' It appears that I can copy "Picture 1"
Sheets("Blank").Unprotect
Sheets("Blank").Shapes("Picture 1").Select
Selection.Copy
' Paste to current tab appears to work
ActiveSheet.Paste
End If
** Problems occur here on second pass**
Selection.ShapeRange.Top = 29.25
Selection.ShapeRange.Left = 323.25
Selection.ShapeRange.Height = 44.25
Selection.ShapeRange.LockAspectRatio = msoTrue
Any suggestions ?
workbook. The image "Picture 1" is on a template called "Test.xlt". It is
copied to a tab called "Blank" in the main workbook and then onto all
subsequent tabs.
The first part of the following code works - copying the image from the
template to blank and repositioning the image. The problem occurs after
copying the image from Blank to the next tab. Each tab is activated in order
and unprotected prior to this call:
If ActiveSheet.Name = "Blank" Then
' This all works
Workbooks.Open FileName:="Test.xlt"
ActiveSheet.Shapes("Picture 1").Select
Selection.Copy
ActiveWindow.Close
Sheets("Blank").Activate
ActiveSheet.Unprotect
ActiveSheet.Paste
Else
' It appears that I can copy "Picture 1"
Sheets("Blank").Unprotect
Sheets("Blank").Shapes("Picture 1").Select
Selection.Copy
' Paste to current tab appears to work
ActiveSheet.Paste
End If
** Problems occur here on second pass**
Selection.ShapeRange.Top = 29.25
Selection.ShapeRange.Left = 323.25
Selection.ShapeRange.Height = 44.25
Selection.ShapeRange.LockAspectRatio = msoTrue
Any suggestions ?