ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to check if folder exists (https://www.excelbanter.com/excel-programming/342676-how-check-if-folder-exists.html)

funkymonkUK[_76_]

how to check if folder exists
 

hi does anybody know how i am find out if the folder already exist
have a macro which opens a specific folder and then creates a ne
folder within. It works how ever everytime I run and if the folde
exists it comes up with an error Run-time error 75 : Path/file acces
error. which is correct as it cannot create two folders exactly th
same.

any ideas around this

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=47577


Jezebel[_3_]

how to check if folder exists
 
trap the error.



"funkymonkUK"
wrote in message
...

hi does anybody know how i am find out if the folder already exist I
have a macro which opens a specific folder and then creates a new
folder within. It works how ever everytime I run and if the folder
exists it comes up with an error Run-time error 75 : Path/file access
error. which is correct as it cannot create two folders exactly the
same.

any ideas around this?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile:
http://www.excelforum.com/member.php...o&userid=18135
View this thread: http://www.excelforum.com/showthread...hreadid=475775




Tom Ogilvy

how to check if folder exists
 
On error resume next
mkdir "C:\ABC"
mkdir "C:\ABC\EFG"
On Error goto 0

--
Regards,
Tom Ogilvy

"funkymonkUK"
wrote in message
...

hi does anybody know how i am find out if the folder already exist I
have a macro which opens a specific folder and then creates a new
folder within. It works how ever everytime I run and if the folder
exists it comes up with an error Run-time error 75 : Path/file access
error. which is correct as it cannot create two folders exactly the
same.

any ideas around this?


--
funkymonkUK
------------------------------------------------------------------------
funkymonkUK's Profile:

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




funkymonkUK[_77_]

how to check if folder exists
 

thanks that workes. thanks agai

--
funkymonkU
-----------------------------------------------------------------------
funkymonkUK's Profile: http://www.excelforum.com/member.php...fo&userid=1813
View this thread: http://www.excelforum.com/showthread.php?threadid=47577



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

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