ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating a folder (https://www.excelbanter.com/excel-programming/350426-creating-folder.html)

peter.thompson[_41_]

Creating a folder
 

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...)


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=501311


Nigel

Creating a folder
 
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"
<peter.thompson.21m19a_1137217802.0932@excelforu m-nospam.com wrote in
message news:peter.thompson.21m19a_1137217802.0932@excelfo rum-nospam.com...

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...)


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile:

http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=501311




peter.thompson[_42_]

Creating a folder
 

That did the trick!

Thanks a bunch

Peter


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=501311



All times are GMT +1. The time now is 05:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com