Help with a little code (runtime 1004)
Posted by Dan on September 18, 2001 5:51 PM
I'm trying to open a file and copy some cells with VBA, but I'm having a problem. On the Range select line I'm getting a run-time 1004 error. Any ideas what is causing this? The file is opening fine. Here is the code:
***********************
Sub datatestcopy()
Application.EnableEvents = False
Application.DisplayAlerts = False
Application.ScreenUpdating = False
ChDir "C:\"
Workbooks.Open Filename:="C:\Data1.xls"
Windows("Data1.xls").Activate
Worksheets("Sheet1").Activate
Range("A1:A20").Select
End Sub
***********************