Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want the to always save the file to the folder that was created with me
changing the directory. The following works fine until it gets to the Active Workbook Save file part. Sub newfold_and_aways_save_to_newfold() Dim strNewFolderName As String strNewFolderName = MonthName(Month(Now())) If Len(Dir("H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName, vbDirectory)) = 0 Then MkDir ("H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName) End If ActiveWorkbook.SaveAs Filename:= _ "H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName \ "RA - ADT Errors Reported - " & Format(Date, "mmm d") & ".xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub Is that possible? If so, can someone show me how? -- Cue |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want to always save the file to the folder that was created without me
changing the directory. The following works fine until it gets to the Active Workbook Save file part. Sub newfold_and_aways_save_to_newfold() Dim strNewFolderName As String strNewFolderName = MonthName(Month(Now())) If Len(Dir("H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName, vbDirectory)) = 0 Then MkDir ("H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName) End If ActiveWorkbook.SaveAs Filename:= _ "H:\2007 C.Morgan ADM017\2007 Revenue Assurance ADM017\ADT Errors\2008\" & strNewFolderName \ "RA - ADT Errors Reported - " & Format(Date, "mmm d") & ".xls" _ , FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub Is that possible? If so, can someone show me how? -- Cue |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|