Creating a new folder in a windows directory with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a process that generates a set of Excel workbooks via an Access
database. This is fully automated and happens at night when there is no one
in the Source DB. Then in the morning, the user comes in and moves the files
from the default folder called "Current Reports" into a new folder Called
060106 indicating the date the reports were generated. These numbered folders
are created each week by the user. I would like to be able to generate these
folders through VBA and save the reports into them automatically. Is this
possible using VBA?

Thanks,
m
 
Use the MkDir function. It creates a directory for you. You will need to
fully qualify the directory name.

MkDir "F:\SomeDirectory\" & Format(Date,"yymmdd")

If it cannot create the directory, you will get an error 76
If your directory name format is other than yymmdd, you will need to change
that.
 
Back
Top