?
Solved

FSO Path Not Found Issue

Posted on 2013-12-18
1
Medium Priority
?
279 Views
Last Modified: 2013-12-18
I am trying to create a folder if it does not exist but I am getting a "Path Not Found" issue in the process.  Here is my code:

    sPath = "c:\h51_software\CCMeet\meets\" & Year(dMeetDate) & "\" & sMeetName & "\rfid"
    If fs.FolderExists(sPath) = False Then
        Set fldr = fs.CreateFolder(sPath)
        Set fldr = Nothing
        
        ts = fs.CreateTextFile(sPath & "\192.168.1.106.txt")
    End If

Open in new window


Any help would be much appreciated.
0
Comment
Question by:Bob Schneider
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 52

Accepted Solution

by:
Rgonzo1971 earned 2000 total points
ID: 39726344
Hi,


As far as I know, CreateFolder only creates the last node. If something in the path different of rfid doesn't exist it won't create it,
Sub myCreateFolder(strPath)
  arrTmp = Split(strPath, "\")
  myPath = tmpArr(0)
  For i = 1 To UBound(arrTmp )
    If Not fs.FolderExists(tmpPath) Then
      fs.CreateFolder myPath 
    End If
    myPath = myPath & "\" & arrTmp(i)
  Next
End Sub 

Open in new window

Regards
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question