Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Code works with Excel 2000 but not with Excel 2002

Still doesn't work with Excel 2002. Gives run time error code 1004
Application-defined or object-defined error

"La Durande" wrote:

the following VBA works with Excel 2000 but gives error 1004 when used with
Excel 2002 (XP)
'
' 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

Have "repaired" Office XP Pro but still won't work

Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code works with Excel 2000 but not with Excel 2002 Tom Ogilvy Excel Programming 0 September 17th 04 09:21 PM
Code works with Excel 2000 but not with Excel 2002 La Durande Excel Programming 0 September 17th 04 08:49 PM
code works in excel 2002, but not in excel 2003 pyc Excel Programming 2 September 2nd 04 01:16 PM
Excel 2000 VBA Code not working in Excel 2002 OldGuy[_2_] Excel Programming 1 August 6th 04 06:26 AM
VBA Code Works in 97, Not in 2002 William[_2_] Excel Programming 11 August 12th 03 02:05 AM


All times are GMT +1. The time now is 10:53 PM.

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"