LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default VBA code help needed

It is not new to 2003 but XP?2002, so you don't have it with 2000.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"JMB" wrote in message
...
Is FileDialog new to Excel 2003? I have Office 2000 and would have

resorted
to using API to browse for the directory

http://www.vba-programmer.com/Snippe...ction_API.html

then FileSearch to return all of the text files.

Sub Import()
Dim myFileName As Variant
Dim FullNameOfDir As String

FullNameOfDir = BrowseFolder("What Folder you want to select?")

With Application.FileSearch
.NewSearch
.LookIn = FullNameOfDir
.SearchSubFolders = True
.Filename = "*.txt"
.MatchTextExactly = True
.FileType = msoFileTypeAllFiles
.Execute
If .FoundFiles.Count 0 Then
For i = 1 To .FoundFiles.Count
myFileName = .FoundFiles(i)
'rest of your code
Next i
End If
End With
End Sub


"mudraker" wrote:


martin

have a look at FileDialog


Extract from help file
Sub UseFileDialogOpen()

Dim lngCount As Long

' Open the file dialog
With Application.FileDialog(msoFileDialogOpen)
.AllowMultiSelect = True
.Show

' Display paths of each file selected
For lngCount = 1 To .SelectedItems.Count
MsgBox .SelectedItems(lngCount)
Next lngCount

End With

End Sub


--
mudraker
------------------------------------------------------------------------
mudraker's Profile:

http://www.excelforum.com/member.php...fo&userid=2473
View this thread:

http://www.excelforum.com/showthread...hreadid=537097




 
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
Need to Improve Code Copying/Pasting Between Workbooks David Excel Discussion (Misc queries) 1 January 6th 06 03:56 AM
regular code module billy boy Excel Discussion (Misc queries) 4 December 13th 05 07:30 PM
can you entre a bar code into a excel cell? basinghughes Excel Worksheet Functions 2 September 9th 05 06:32 PM
VLOOKUP for Zip Code Ranges JerseyJR Excel Worksheet Functions 2 September 6th 05 06:37 PM
Concatinate a filename CLR Excel Discussion (Misc queries) 28 August 1st 05 11:45 PM


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