By FileSystemObject we can do operation with File and folder..Here is code for that..
Sub GetAllFilesInAFolder() Dim fso As New Scripting.FileSystemObject Dim flFIle As File Dim fdFOlder As Folder Set fdFOlder = fso.GetFolder("C:\Documents and Settings\Cyber Junction\My Documents") For Each flFIle In fdFOlder.Files 'Do you all OPeration with FIle here Next set fso=nothing set flFIle =nothing set fdFOlder =nothing End Sub On Sat, Dec 3, 2011 at 6:25 PM, Sam Mathai Chacko <samde...@gmail.com>wrote: > Rakesh, > > Application.FileSearch has been discontinued from Excel 2007 for reasons I > am still not sure why. You can find an alternative method here. > > http://www.ozgrid.com/forum/showthread.php?t=147929 > > Regards, > Sam Mathai Chacko > > > On Sat, Dec 3, 2011 at 6:20 PM, Rakesh Joshi <rakesh.ri...@gmail.com>wrote: > >> Hi Ashish, >> >> i need to open all files in a folder and run the macro regarding macro i >> can take care but opening all files in folder i am getting trouble >> application .filesearch is not working 2010 coudl you please let me know >> how to do that. >> >> -- >> Rakesh Joshi >> >> -- >> FORUM RULES (934+ members already BANNED for violation) >> >> 1) Use concise, accurate thread titles. Poor thread titles, like Please >> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice >> will not get quick attention or may not be answered. >> >> 2) Don't post a question in the thread of another member. >> >> 3) Don't post questions regarding breaking or bypassing any security >> measure. >> >> 4) Acknowledge the responses you receive, good or bad. >> >> 5) Cross-promotion of, or links to, forums competitive to this forum in >> signatures are prohibited. >> >> NOTE : Don't ever post personal or confidential data in a workbook. Forum >> owners and members are not responsible for any loss. >> >> >> ------------------------------------------------------------------------------------------------------ >> To post to this group, send email to excel-macros@googlegroups.com >> > > > > -- > Sam Mathai Chacko > > -- > FORUM RULES (934+ members already BANNED for violation) > > 1) Use concise, accurate thread titles. Poor thread titles, like Please > Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice > will not get quick attention or may not be answered. > > 2) Don't post a question in the thread of another member. > > 3) Don't post questions regarding breaking or bypassing any security > measure. > > 4) Acknowledge the responses you receive, good or bad. > > 5) Cross-promotion of, or links to, forums competitive to this forum in > signatures are prohibited. > > NOTE : Don't ever post personal or confidential data in a workbook. Forum > owners and members are not responsible for any loss. > > > ------------------------------------------------------------------------------------------------------ > To post to this group, send email to excel-macros@googlegroups.com > -- Regards Rajan verma +91 9158998701 -- FORUM RULES (934+ members already BANNED for violation) 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Cross-promotion of, or links to, forums competitive to this forum in signatures are prohibited. NOTE : Don't ever post personal or confidential data in a workbook. Forum owners and members are not responsible for any loss. ------------------------------------------------------------------------------------------------------ To post to this group, send email to excel-macros@googlegroups.com