L
La Durande
the following VBA works with Excel 2000 but gives error 1004 when used with
2002
'
' 14/09/2004 by Alf Dorrian
'
Range("A2:M73").Select
Selection.Copy
Workbooks.Add
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=False
Application.CutCopyMode = False
Filesavename = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If Filesavename <> False Then
(the code below this gives the error)
ActiveSheet.SaveAs Filename:=Filesavename, FileFormat:= _ xlNormal,
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _ , CreateBackup:=False
End If
ActiveWorkbook.Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=False
End Sub
2002
'
' 14/09/2004 by Alf Dorrian
'
Range("A2:M73").Select
Selection.Copy
Workbooks.Add
Range("A2").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=False
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:=False _
, Transpose:=False
Application.CutCopyMode = False
Filesavename = Application.GetSaveAsFilename( _
fileFilter:="Excel Files (*.xls), *.xls")
If Filesavename <> False Then
(the code below this gives the error)
ActiveSheet.SaveAs Filename:=Filesavename, FileFormat:= _ xlNormal,
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _ , CreateBackup:=False
End If
ActiveWorkbook.Close SaveChanges:=False
ActiveWorkbook.Close SaveChanges:=False
End Sub