You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-11Lines changed: 21 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,13 @@
1
-
# Excel-VBA-Directory-Manager
2
-
Uses a single Class to parse all the files and folders in a specified directory without using FileSystemObject or setting special references. Perfect for integrating into projects you can distribute to the lay person without worrying if they have set their references correctly in the VBA editor.
1
+
# ExcelVBADirectoryManager
2
+
Parse all the files and folders in a specified directory without using FileSystemObject or setting special references. Perfect for integrating into projects you will distribute to the lay person without worrying if they have set their references correctly in the VBA editor.
3
3
4
4
## Requirements
5
5
- Microsoft Office 2007 or newer (Not tested for earlier versions)
6
6
- A macro enabled file
7
-
- Knowledge of how to [add a Class module](https://analystcave.com/vba-vba-class-tutorial/) to your project
8
7
9
8
## Getting Started
10
9
A single Class file contains all functionality. To use it in your project, use one of the following methods to add them in the IDE:
11
10
12
-
To use it in your project, then use one of the following methods to add them in the IDE.
13
-
14
11
- Save the [source code module](/DirectoryManager.cls) to your machine, then import it into the Project using the IDE
15
12
16
13
Or,
@@ -33,10 +30,15 @@ Or,
33
30
34
31
# Example Use
35
32
36
-
The below examples are also located in the [example workbook](/ExampleWorkbook.xlsm).
33
+
DirectoryManager is simple and fast to set up. The below examples will walk you through common use. They are also located in the [example workbook](/ExampleWorkbook.xlsm).
37
34
38
35
## Initial Setup, Printing All Files/Folders
39
36
37
+
The first step is to declare the variable and initialize it with a path. The path can be to either a folder or a file.
38
+
39
+
If set to a folder, DirectoryManager then parses all the files, folders, and subfolders in that location. These are stored and accessed in Collections.
40
+
41
+
40
42
```VBA
41
43
Sub CreateNewDirectoryManager()
42
44
@@ -78,6 +80,8 @@ End Sub
78
80
## Use Omitted Characters to Exclude Files or Folders
79
81
Setting the `OmittedPrefix` property to a non-empty string will cause the DirectoryManager to exclude any file or folder that starts with that string.
80
82
83
+
This is useful if you want to use DirectoryManager to exclude specific folders or files from your project.
84
+
81
85
```VBA
82
86
Sub SetOmmitedPrefix()
83
87
@@ -114,11 +118,11 @@ Sub SetOmmitedPrefix()
114
118
115
119
End Sub
116
120
```
117
-
Changing `OmittedPrefix` will cause the DirectoryManager to re-parse the file or folder set at the current `Path`.
121
+
Changing `OmittedPrefix`at any time will cause the DirectoryManager to re-parse the file or folder set at the current `Path`.
118
122
119
123
## Check if a File or Folder Exists
120
124
121
-
The DirectoryManager can easily tell you if a file or folder at the specified `Path` exists.
125
+
The DirectoryManager can tell you if a file or folder at the specified `Path` exists.
122
126
123
127
```VBA
124
128
Sub CheckIfFileOrFolderExists()
@@ -145,10 +149,16 @@ Sub CheckIfFileOrFolderExists()
145
149
End Sub
146
150
```
147
151
152
+
# Contributing and Outlook
148
153
149
-
# License
150
-
Distributed under the MIT License. See [LICENSE](./LICENSE) for more information.
154
+
I am not actively pursuing additional development. This Class resource has all intended functionality in version 1.0. I consider it feature complete, but will continue to provide bug support.
155
+
156
+
That said, I will in no way turn away additional contributions or expansions if beneficial or needed in the future.
151
157
158
+
All are welcome to open an issue or feature request.
159
+
160
+
# License
161
+
Distributed under the [MIT License](./LICENSE), copyright 2022.
152
162
153
163
# Contact
154
-
Reach me on [LinkedIn](https://www.linkedin.com/in/mscottlassiter/) or [Twitter](https://twitter.com/MScottLassiter).
164
+
Reach me on [LinkedIn](https://www.linkedin.com/in/mscottlassiter/) or [Twitter](https://twitter.com/MScottLassiter).
0 commit comments