I am trying to save a file automatically with a macro. the idea is to
•look at the location it is located in
•see if the folder exists
•if it does, save the document in that folder
•if it does not,create the folder then save the document in the folder
I have the proper coding to make this work on my local computer. That coding is:
Now I am changing the location to http://ati-sharepoint:1235/sites/**...g Master/test/If Len(Dir("C:\Documents and Settings\smakatura\My Documents\call report\Call Reports\School 010\01-01-04", vbDirectory)) = 0 Then MkDir "C:\Documents and Settings\smakatura\My Documents\call report\Call Reports\School 010\01-01-04" End If ActiveWorkbook.SaveAs Filename:= _ "C:\Documents and Settings\smakatura\My Documents\call report\Call Reports\School 010\01-01-04\Admissions Call Log Master 01-01-04 10.xlsm" _ , FileFormat:=xlOpenXMLWorkbookMacroEnabled, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close
I am able to get the second part of the function to work (the part that actually saves) but not the check to see if folder exists part.
the part that is not working is underlined.
Can someone help me get the red part to work? I feel like I am just missing syntax. I am hoping it is possible since the black part works find by itself.If Len(Dir("http://ati-sharepoint:1235/sites/cdr/Documents/Admissions Call Log Master/test", vbDirectory)) = 0 Then MkDir "http://ati-sharepoint:1235/sites/cdr/Documents/Admissions Call Log Master/test" End If ActiveWorkbook.SaveAs Filename:= _ "http://ati-sharepoint:1235/sites/cdr/Documents/Admissions Call Log Master/test/01-01-04.xls" _ , FileFormat:=xlExcel8, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False ActiveWindow.Close
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks