G
Guest
Hi there,
I've created this simple open event macro, (in ThisWorkbook of Book1) but it
fails at the indicated line and I can't figure out why. The macro works fine
from within a module. It gives the error "Script out of range", but Book1 is
definately open and was opened at the start of the macro.
Private Sub Workbook_Open()
Workbooks.Open Filename:="C:\Book1.xls"
Cells.Select
Selection.Copy
Windows("Book2.xls").Activate
Cells.Select
ActiveSheet.Paste
Columns("H:H").Select
Application.CutCopyMode = False
Selection.NumberFormat = "[$-809]dd mmmm yyyy;@"
Windows("Book1.xls").Activate <<<<<<<<<<<<<<
ActiveWindow.Close
End Sub
Any ideas?
J
I've created this simple open event macro, (in ThisWorkbook of Book1) but it
fails at the indicated line and I can't figure out why. The macro works fine
from within a module. It gives the error "Script out of range", but Book1 is
definately open and was opened at the start of the macro.
Private Sub Workbook_Open()
Workbooks.Open Filename:="C:\Book1.xls"
Cells.Select
Selection.Copy
Windows("Book2.xls").Activate
Cells.Select
ActiveSheet.Paste
Columns("H:H").Select
Application.CutCopyMode = False
Selection.NumberFormat = "[$-809]dd mmmm yyyy;@"
Windows("Book1.xls").Activate <<<<<<<<<<<<<<
ActiveWindow.Close
End Sub
Any ideas?
J