Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 253
Default Creating directories from excel

Hi Kevin
The Dir function test the existence of the folder (works for file as well)
MkDir create the specified directory

Sub test()
If Dir("C:\TempTest\") = "" Then
MkDir ("C:\TempTest\")
End If
End Sub
Regards,
Jean-Yves

"Keivn Green" wrote in message
...
I would like to create a directory using a macro which is easy enough, but
how can I have it verify whether or not its there?

would it be "if dir: blablabla = true then"?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Creating directories from excel


You can also just skip the test and create it. If it exists, an error will
be raised which can be ignored

Sub test()
On Error Resume Next
MkDir ("C:\TempTest\")
On Error goto 0
End Sub

--
Regards,
Tom Ogilvy


"Keivn Green" wrote in message
...
ThankYou!!!

"Jean-Yves" wrote:

Hi Kevin
The Dir function test the existence of the folder (works for file as

well)
MkDir create the specified directory

Sub test()
If Dir("C:\TempTest\") = "" Then
MkDir ("C:\TempTest\")
End If
End Sub
Regards,
Jean-Yves

"Keivn Green" wrote in message
...
I would like to create a directory using a macro which is easy enough,

but
how can I have it verify whether or not its there?

would it be "if dir: blablabla = true then"?






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I get excel files to open automatically from directories? Damian Excel Discussion (Misc queries) 2 January 3rd 06 02:51 PM
creating directories freekrill Excel Discussion (Misc queries) 1 July 25th 05 09:26 AM
Excel VBA - Creating Directories th1chsn Excel Programming 3 August 26th 04 06:00 PM
Creating a list of directories mousetrap Excel Programming 1 July 24th 04 05:22 AM
Creating Directories Keith[_11_] Excel Programming 3 June 23rd 04 12:44 PM


All times are GMT +1. The time now is 02:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"