Solved

FSO Path Not Found Issue

Posted on 2013-12-18
1
278 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 500 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month9 days, 18 hours left to enroll

623 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