Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
plh plh is offline
external usenet poster
 
Posts: 48
Default Can I do this autoselect with GetOpenFileName or the Dir function?

I have an application that is semi-automated in that to kick it off I use the
GetOpenFileName method to allow the user (me) to select 51 files for processing.
There are always 51 files, always with the extension ".txt", and always arranged
in descending order by date of creation. Right now I open the dialog box, which
has the .txt filter active, arrange in descending order by date, highlight, hold
down the shift key & count down the 51 files as I hit the down arrow key. I was
wondering if there is some way to automate that part of it using the "dir"
function. The procedure is always the same. I don't really have to open the
dialog box, because the files to be processed always reside in the same place.
Thank You,
-plh


--
Where are we going and why am I in this HAND BASKET??
  #2   Report Post  
Posted to microsoft.public.excel.programming
r r is offline
external usenet poster
 
Posts: 125
Default Can I do this autoselect with GetOpenFileName or the Dir function?



Sub test_SFO()
Dim FSO As Object
Dim F
Dim Fo
Dim s As String

Set FSO = CreateObject("Scripting.FileSystemObject")
s = "D:\Documents and Settings\mensar\Documenti\lavoro\prove excel2"

If FSO.FolderExists(s) Then
Set Fo = FSO.GetFolder(s)
For Each F In Fo.Files
Debug.Print F.Name
Debug.Print F.Type
Next
End If
End Sub

regards
r

Il mio ultimo lavoro ...
http://excelvba.altervista.org/blog/...ternative.html


"plh" wrote:

I have an application that is semi-automated in that to kick it off I use the
GetOpenFileName method to allow the user (me) to select 51 files for processing.
There are always 51 files, always with the extension ".txt", and always arranged
in descending order by date of creation. Right now I open the dialog box, which
has the .txt filter active, arrange in descending order by date, highlight, hold
down the shift key & count down the 51 files as I hit the down arrow key. I was
wondering if there is some way to automate that part of it using the "dir"
function. The procedure is always the same. I don't really have to open the
dialog box, because the files to be processed always reside in the same place.
Thank You,
-plh


--
Where are we going and why am I in this HAND BASKET??

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
AutoSelect? in Drop Down List Box Amean1 Excel Worksheet Functions 1 August 27th 06 04:31 PM
Autoselect data using Macros [email protected] Excel Programming 4 June 2nd 06 06:28 PM
GetOpenFileName help Leith Ross[_12_] Excel Programming 0 April 8th 05 10:14 PM
GetOpenFilename Greg Bloom Excel Programming 0 February 9th 04 03:32 PM
VBA Autoselect problem godgo Excel Programming 1 January 14th 04 12:31 PM


All times are GMT +1. The time now is 05:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"