Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 160
  • Last Modified:

Creating a new directory to save files

When saving an excel file often times my programming will call for a file to be saved in a directory that doesn't exist.  What is the code necessary for creating a new directory where the Workbook can then be saved?  e.g. at the beginning of a new month the programming will try to save the Workbook in a directory C:\Apr-03 however this directory doesn't exist (unless i manually create it, which is what i am doing now.
0
lockbox
Asked:
lockbox
  • 3
1 Solution
 
vinnyd79Commented:
mkdir C:\Apr-03
0
 
vinnyd79Commented:
forgot the quotes:
mkdir "C:\Apr-03"
0
 
lockboxAuthor Commented:
thanks pal, i knew it had to be something pretty straight forward
0
 
vinnyd79Commented:
you could also check to make sure the directory exists with something like this:

If Dir("C:\Apr-03", vbDirectory) = "" Then MkDir "C:\Apr-03"
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now