PC Review


Reply
Thread Tools Rate Thread

check to ensure all files in folder

 
 
=?Utf-8?B?U2FyYWg=?=
Guest
Posts: n/a
 
      14th Jun 2007
I have a file folder where i store numerous employee timesheets - what macro
can i run to ensure that all employee timesheets are in the folder? what
information is needed to answer my question?
 
Reply With Quote
 
 
 
 
Jim Cone
Guest
Posts: n/a
 
      15th Jun 2007

This will list all files in the "strPath" folder...
'--
Sub ListAllFilesInFolder()
Dim strPath As String
Dim oFSO As Object
Dim oFile As Object
Dim oFolder As Object
Dim N As Long
N = 1
strPath = "C:\Documents and Settings\Excel Files"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(strPath)
Cells(N, 1).Value = oFolder.Path
N = N + 1
For Each oFile In oFolder.Files
Cells(N, 2).Value = oFile.Name
N = N + 1
Next 'oFile

Set oFSO = Nothing
Set oFile = Nothing
Set oFolder = Nothing
End Sub
'--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware



"Sarah" <(E-Mail Removed)>
wrote in message
I have a file folder where i store numerous employee timesheets - what macro
can i run to ensure that all employee timesheets are in the folder? what
information is needed to answer my question?
 
Reply With Quote
 
=?Utf-8?B?U2FyYWg=?=
Guest
Posts: n/a
 
      15th Jun 2007
This is only returning the following:

U:\Payroll\June 15 Payroll - Adv
DisplayAdvertising10-27-06.xls


"Jim Cone" wrote:

>
> This will list all files in the "strPath" folder...
> '--
> Sub ListAllFilesInFolder()
> Dim strPath As String
> Dim oFSO As Object
> Dim oFile As Object
> Dim oFolder As Object
> Dim N As Long
> N = 1
> strPath = "C:\Documents and Settings\Excel Files"
> Set oFSO = CreateObject("Scripting.FileSystemObject")
> Set oFolder = oFSO.GetFolder(strPath)
> Cells(N, 1).Value = oFolder.Path
> N = N + 1
> For Each oFile In oFolder.Files
> Cells(N, 2).Value = oFile.Name
> N = N + 1
> Next 'oFile
>
> Set oFSO = Nothing
> Set oFile = Nothing
> Set oFolder = Nothing
> End Sub
> '--
> Jim Cone
> San Francisco, USA
> http://www.realezsites.com/bus/primitivesoftware
>
>
>
> "Sarah" <(E-Mail Removed)>
> wrote in message
> I have a file folder where i store numerous employee timesheets - what macro
> can i run to ensure that all employee timesheets are in the folder? what
> information is needed to answer my question?
>

 
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
A quick check to tel if there are files in a folder Gavaskar Microsoft C# .NET 0 21st May 2009 08:00 PM
Check Folder For Files =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Misc 6 20th Nov 2007 11:16 PM
Check if a folder has x files in it. =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Misc 8 15th Nov 2007 03:35 PM
Check location of current db to ensure it is not a copy =?Utf-8?B?TmljZWFjdGlvbg==?= Microsoft Access Security 1 9th Aug 2007 12:54 PM
Check to ensure server and db available Earl Microsoft ADO .NET 7 12th Aug 2005 04:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:24 AM.