Solved

FSO Path Not Found Issue

Posted on 2013-12-18
1
276 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
1 Comment
 
LVL 50

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…

808 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