Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you very much. It worked.
"joel" wrote: Error 1004 is due to the fact that wb2 is not defined in the code. You need to set wb2 to a workbook name set wb2 = SaveCopyAs(TempFilePath & TempFileName & FileExtStr) You also can't use a slash ifin a filename a will have an error in this statment TempFileName = "Copy of " & wb1.Name & " " & Format(Now, "dd/mmm/yy") Replace theh slashes with underscore TempFileName = "Copy of " & wb1.Name & " " & Format(Now, "dd_mmm_yy") You can also simplify this statemnt from FileExtStr = "." & LCase(Right(wb1.Name, Len(wb1.Name) - InStrRev(wb1.Name, ".", , 1))) to FileExtStr = LCase(mid(wb1.Name, InStrRev(wb1.Name, "."))) -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=147452 . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Run Time Error 1004: Application or Object Defined Error | Excel Programming | |||
Run Time 1004 Error: Application or Object Difine Error | Excel Programming | |||
run-time error '1004': Application-defined or object-deifined error | Excel Programming | |||
Application Run Time Error 1004 and Stack Error | Excel Programming |