LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default A bit bamboozeled

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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"