From the course: Excel VBA: Managing Files and Data
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Determine if a folder (directory) exists - Microsoft Excel Tutorial
From the course: Excel VBA: Managing Files and Data
Determine if a folder (directory) exists
- [Instructor] In the previous movie, I showed you how to check, to determine whether a file with a specific name existed or not. In this movie, I will show you how to do the same thing, but in this case, instead of looking for a file, we're looking for a directory. The sample workbook that I'll start in is 0202, check for folder. And you can find that in the chapter two folder of the exercise files collection. We'll run our code from this workbook. So we won't actually use any of the data in the worksheet. So I'll press Alt + F11 to move to the Visual Basic editor. And here I have a code module, Module1, and I have a function and a sub-routine that will call the function. The function as the name implies, PathThere, looks to see if a particular directory path is available. For this exercise, we'll look to see if the chapter two folder of the exercise files collection is present on your system. That means that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Determine if a workbook exists4m 36s
-
(Locked)
Determine if a folder (directory) exists4m 49s
-
(Locked)
Detect whether a file is open5m 6s
-
(Locked)
Open a workbook2m 35s
-
(Locked)
Close a workbook5m 31s
-
(Locked)
Save a workbook under a new name4m 21s
-
(Locked)
Save a workbook as a CSV file4m 43s
-
(Locked)
-
-
-
-
-
-