In the past I’ve been using several implementations of VBA-code that allowed me to select files and/or directories using a dialog-box. I’ve never stumbled on one that really gives me all that I would need yet (maybe I didn’t look in the right places?).
Recently Chip Pearson put some nice examples (+ code) on his great website (http://www.cpearson.com/excel.htm) but also there I’m still missing what I think I need. Still, I’d say this should not be all that difficult, let me try to describe:
- Use Excel VBA-code to trigger a dialog box (could be a ‘standard’ Windows dialog called by API)
- Dialog should return array of selected files and/or folders
- Nice to have would be ablity for user to select files using Shift & Ctrl as standard in Windows
- Nice to have would be possibility to preset what may be selected: one file, more files, only files, only one folder, more folders, files and folders
- Nice to have would be possibility to select that i.s.o. a selected folder, the code returns all files in that folder (and subfolders?). And therefore, if files and folders are selected, it would return all files
- Tool should return path and file-name either by presetting what is required or e.g. the path in column 1 of the array, the filename in column2 and the extension in column 3 (maybe this can even be extended to include more info like attributes, filedate, filetime, filesize)
- Allow dialog-box title to be set from code
- Allow initial/default drive&folder
- Also return or remember selected directory such that on a next call to the routine, this could be set as initial drive&folder
[/list]Oh… of course the basic stuff would already be great, the nice-to-haves etc. is my imagination running wildFinally, given some “basis-code”, maybe I’ll tweak things myself and will post the results back here.
Erik Jan