Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default listing the names of files


Hi Tim,

It appears no one has provided a solution for you. I've been
unavailable for a while, so sorry for the delay...

This may work for you (it's untested); see my addional code added in
BOLD:

Code:
--------------------
Sub ConvertFiles()
Dim vrtSelectedItem As Variant
Dim FileToOpen As String
'Declare a variable as a FileDialog object.
Dim fd As FileDialog
Set fd = Application.FileDialog(msoFileDialogFolderPicker)
fd.Title = "Cool Application"
fd.InitialFileName = "My Documents"
If fd.Show = -1 Then
For a = 1 To fd.SelectedItems.Count
MsgBox fd.SelectedItems(a)
Dim NextFile As String

NextFile = Dir(fd.SelectedItems(a) & "\*detail*.*")
Workbooks.Open Filename:=NextFile
ActiveWorkbook.SaveAs Filename:= _
NextFile & ".wk4", _
FileFormat:=xlWK4, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
NextFile = Dir()

Do While NextFile < ""
Workbooks.Open Filename:=NextFile
ActiveWorkbook.SaveAs Filename:= _
NextFile & ".wk4", _
FileFormat:=xlWK4, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
NextFile = Dir()
Loop
Next
' CREATE A NEW WORKBOOK AND LIST/COUNT FILES...
WORKBOOKS.ADD
FOR A = 1 TO FD.SELECTEDITEMS.COUNT
' ADD FILE NAME TO SHEET...
ACTIVESHEET.CELLS(A, 1).VALUE = FD.SELECTEDITEMS(A)
NEXT A
' ADD FILE COUNT TO SHEET...
ACTIVESHEET.CELLS(A + 1, 1).VALUE = \"TOTAL FILES: \" & FD.SELECTEDITEMS.COUNT
End If
End Sub
--------------------

Hope this helps,
theDude


--
theDude
------------------------------------------------------------------------
theDude's Profile: http://www.excelforum.com/member.php...o&userid=16550
View this thread: http://www.excelforum.com/showthread...hreadid=372302

Reply
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
Listing Names in a spreadsheet MGaddict Excel Discussion (Misc queries) 1 January 29th 08 12:27 PM
Listing names and id and corresponding software NeedExcelHelp07 Excel Worksheet Functions 3 May 31st 07 06:58 PM
Listing the names of your worksheets gunslinger Excel Discussion (Misc queries) 3 May 30th 06 11:12 PM
listing all names in a worksheet tthe Excel Discussion (Misc queries) 4 January 20th 06 02:19 PM
Listing of Sheet names Will Fleenor Excel Worksheet Functions 1 November 17th 04 05:19 PM


All times are GMT +1. The time now is 03:44 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"