PC Review


Reply
Thread Tools Rate Thread

Can I do this autoselect with GetOpenFileName or the Dir function?

 
 
plh
Guest
Posts: n/a
 
      1st Jun 2009
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 With Quote
 
 
 
 
r
Guest
Posts: n/a
 
      1st Jun 2009


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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autoselect range WK Microsoft Excel Misc 1 13th Nov 2004 06:43 PM
Help with VBE Need to autoselect rows greenfalcon Microsoft Excel Misc 1 21st Sep 2004 01:07 PM
Help with VBE Need to autoselect rows greenfalcon Microsoft Excel Misc 0 20th Sep 2004 09:07 PM
Help with VBE Need to autoselect rows greenfalcon Microsoft Excel Misc 1 20th Sep 2004 05:46 PM
mouse autoselect Windows XP Customization 2 18th Dec 2003 02:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:01 PM.