MY SOLUTION
1. Download "Printfolders 1.2" from
http://www.gmayor.com/downloads.htm
2. Instal with shortcuts on Desktop and Start > Programs.
3. Created folder: C:\PrintFolders_Output
4. Run PrintFolders.
5. Set Output file to: C:\PrintFolders_Output\Filename_List.txt
(NEVER CHANGE THE OUTPUT FILE LOCATION OR NAME)
6. Create Desktop shortcut to this file (Optional).
(USE TO PRINT LIST OR COPY AND PASTE INTO WORD.)
7. Run Excel and record Macro in Personal Workbook.
using "Data > Get External Date > From TextFile"
8. Slightly modified resultant VBA Macro for Excel 2000 as follows:
_________________________________________________________
Sub Import_Filename_List_ex_PrintFolders()
'
' Import_Filename_List_ex_PrintFolders Macro
' Macro recorded 13/12/2005 by xxxxxx
'
'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\PrintFolders_Output\Filename List.txt", _
Destination:=Selection)
.Name = "Filename List_2"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = xlWindows
.TextFileStartRow = 4
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1)
.Refresh BackgroundQuery:=False
End With
End Sub
____________________________________________________________
The key modification was to change the "Destination:=" to "Selection".
The recording set the destination to a specific Cell "Range (C4)"
where the cursor was when the Macro was recorded.
You can also edit the path and name of the source file in the Macro.
The macro may require changes if you wish to parse the data differently.
I am just importing bare filenames.
If you only have one requirement and do this in the original macro
recording, then the macro will incorporate the appropriate action.
However, if your requirement is variable, there would be a problem.
_____________________________________________________________
9. Using Tools > Customise > Commands"
Insert Macro Button on Toolbar by Drag and Drop.
10. Right click on button:
- Asign the above Macro.
- Copy Button Image from "Data > Import Textfile".
- Paste to the new Button.
- Set display to "Default Style".
11. Rename Button: &Import Filename List ex 'PrintFolders'
RESULT
Use "Printfolders" to create the list.
Then, in Excel,:
Place Cursor in desired top left cell.
Click on the new Macro Button.
DONE "Instantly"
If you could "Call" "PrintFolders" from within Excel you could have a one
step solution for Excel but the above provides the advantage of being able
to use the filename list elsewhere than just in Excel.
I'm pretty happy.