E024.xls - Object doesnt' support this action

NelsonC

New Member
Joined
Jun 14, 2012
Messages
2
I just bought "Office VBA Macros you can use today" and wanted to try a macro: "Creating a list of files that reside in a directory".
I was disappointed to see that it choked at line 31: "With Application.FileSearch", with the error message: "Object doesnt' support this action".

I am a beginner with VBA and wonder if any one has a fix for this...
You can find the entire file and many others (I have not tryied yet :eeek:), in the section for the title of this book (a .zip file).
Here is the snipplet from the code that stops the macro.


'New FileSystemObject
Set FSO = CreateObject("Scripting.FileSystemObject")
With Application.FileSearch
.NewSearch
.LookIn = Folder
.SearchSubFolders = LookInSubFolders
.FileType = msoFileTypeAllFiles
.Execute
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.



Thanks for the info. I am using MS Excel 2010 Professional. While I understand (I think) some of the code, I have no clue where to use the suggestions you gave me. I wonder if the authors of the book, may have an update.
 
Upvote 0
Thanks for the info. I am using MS Excel 2010 Professional. While I understand (I think) some of the code, I have no clue where to use the suggestions you gave me. I wonder if the authors of the book, may have an update.
Your welcome. I think it depends on exactly what you want to achieve? I suggest perhaps try some of the other beginner tutorials from your book first and then you can come back to this if your just starting out.
 
Upvote 0

Forum statistics

Threads
1,223,246
Messages
6,170,996
Members
452,373
Latest member
TimReeks

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top