LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Test if folder exists, create if it doesn't?

Shawn,

Try something like the following:

Dim PathName As String
PathName = "C:\Temp"
On Error Resume Next
MkDir PathName
On Error GoTo 0
ChDrive PathName
ChDir PathName


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"43fan" wrote in message
...
I'm sure this is simple, but after going through the Excel help

file, all it
has done is confuse me. ;) Basically, I just want to see if a

folder
exists, if it does, change to the folder, if it doesn't, create

it, then
change to there.

I'll be getting user inputs that will be concatenated to come

up with the
folder name I'm looking for/changing to. As well, I'll use

that same info
to name some files that will be saved into that folder.

Thanks!!
Shawn


--
Join the newest in Fantasy Sports.

http://www.6FantasySports.com
(this site supports the Victory Junction Gang Camp with a

portion of all
proceeds)




 
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
Test if file exists Daniel Bonallack Excel Discussion (Misc queries) 2 May 4th 09 04:19 PM
How to check if a file exists in an ftp folder LL Cool A Excel Discussion (Misc queries) 3 May 16th 06 09:22 PM
Test if a folder exists Jeff Marshall Excel Programming 6 September 30th 03 05:21 PM
Checking to see if Folder exists Dan[_25_] Excel Programming 2 September 24th 03 02:42 AM
Test to see if a worksheet exists thanks, Chip CT[_2_] Excel Programming 0 August 22nd 03 03:17 AM


All times are GMT +1. The time now is 03:19 AM.

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

About Us

"It's about Microsoft Excel"