Creating a folder

  • Thread starter Thread starter peter.thompson
  • Start date Start date
P

peter.thompson

When a workbook is opened for the first time, I want to automate the
creation of a "Business Cases" folder on the user's C drive.

Can anyone guide me with the required code to:

Test if "C:/Business Cases" exists, and if it doesn't create the
folder

Any assistance much appreciated

Cheers

Peter (new to VBA...slowly getting there...)
 
In the workbook code area place this ........


Private Sub Workbook_Open()
If Dir("C:\Business Cases\", vbDirectory) = "" Then MkDir "C:\Business
Cases"
End Sub


--
Cheers
Nigel



"peter.thompson"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top