Thread: Windows error
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Windows error


paste this


?"New Hire" & "(" & Site & " " & Last_Name & ", " & First_Name & " " &
Hire_Date & ")" & ".xls"
into the Immediate window & hit return
does it evaluate into what Excel would recognise at the windows name?



"Neecy" wrote in message
...
Hello-
I am having a debug error that comes up from the script listed below:

' Copy "Term" data to new workbook
Windows("New Hire" & "(" & Site & " " & Last_Name & ", " & First_Name &
" " & Hire_Date & ")" & ".xls").Activate
Sheets("Term Form").Activate
Range("A1:z100").Select
Selection.Copy
Range("a1").Select
Windows("Term" & Site & Last_Name & First_Name & ".xls").Activate
Sheets("Sheet1").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteColumnWidths, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks
_
:=False, Transpose:=False
Application.CutCopyMode = False
Range("A1").Select


Application.CutCopyMode = False

ActiveWorkbook.Save

End Sub


This script is to write the selected details over to a new workbook on a
new
worksheet. The error appears from the 1st line of the windows statement.
Could someone review and tell me when I am going wrong?

Thanks-

Neecy