Solved

FSO Path Not Found Issue

Posted on 2013-12-18
1
277 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 51

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

751 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