Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using excel 2003. The user enters a path name where he wants to save a
file. I need this code to check to see if the directory they enter exists and if not I want to make the directory for them. This is the code I'm using, but I get the error path not found when the program tries to save it. Worksheets("ticket").Activate strappend = ActiveSheet.Range("j8").Value strpath = ActiveSheet.Range("b200").Value str3 = ActiveSheet.Range("c8").Value MsgBox strpath Rem making directory if it doesn't exist If Dir(strpath, vbDirectory) = "" Then MkDir strpath fsavename = strpath & strappend & str3 & ".xls" ThisWorkbook.SaveAs Filename:=fsavename I am using the msgbox to make sure the path entered is getting assigned to strpath and it is. J8 and C8 are the file name. In his case strpath = c:\2008\Jun\ J8 = C005482 and C8 = Encana. I checked and the folder c:\2008\jun\ was not created. Any help would be appreciated. Jim |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
creating a directory if one doesn't already exist | Excel Programming | |||
Windows Message when Directory Already Exist | Excel Programming | |||
Check if a pre0defined number of workbooks exist in a specific directory | Excel Programming | |||
Save to directory and create if not exist | Excel Programming | |||
How to check if a folder/directory exist using VBA | Excel Programming |