Solved

Folder Creator

Posted on 2003-10-24
2
215 Views
Last Modified: 2013-12-03
I need to code to check if a folder exists and if the folder doesnt create it!!! thanx in advance

Text1.Text = the path
0
Comment
Question by:burnttime
[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
2 Comments
 
LVL 1

Accepted Solution

by:
TwistD_PissR earned 30 total points
ID: 9616059
Dim FSO As Object
Dim sNewFolder As String
   
  sNewFolder = Text1.Text
  Set FSO = CreateObject("Scripting.FileSystemObject")
  If Not FSO.FolderExists(sNewFolder) Then
    FSO.CreateFolder sNewFolder
  End If
  Set FSO = Nothing



TwistD
0
 
LVL 28

Expert Comment

by:vinnyd79
ID: 9617295
Why not just use:

If Dir(Text1.Text, vbDirectory) = "" Then MkDir Text1.Text



0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Excel - Save a copy of work book 13 91
Access query that references subform 5 48
SLMGR Switches Are Not Working On KMS Host 3 146
Send outlook email from VBS Script 2 59
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…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

726 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