Excel VBA Microsoft Scripting Runtime not in Excel 2010

Kurt

Well-known Member
Joined
Jul 23, 2002
Messages
1,664
I have the following code:

Code:
Dim objFSO As FileSystemObject
Sub Button1_Click()
    'Sub ListFiles()
    'Set a reference to Microsoft Scripting Runtime by using
     'Tools > References in the Visual Basic Editor (Alt+F11)
     'Declare the variable
     'Insert the headers for Columns A through F
     Range("A1").Value = "File Name"
     Range("B1").Value = "File Size"
     Range("C1").Value = "File Type"
     Range("D1").Value = "Date Created"
     Range("E1").Value = "Date Last Accessed"
     Range("F1").Value = "Date Last Modified"
     
     'Create an instance of the FileSystemObject
     Set objFSO = CreateObject("Scripting.FileSystemObject")
     
     'Call the RecursiveFolder routine
     Call RecursiveFolder(objFSO, "C:\_Dox\aMobius", True)
     
     'Change the width of the columns to achieve the best fit
     Columns.AutoFit
End Sub

I do not see a Microsoft Scripting Runtime when I look at the Tools References in Excel 2010.

What do I need to do to get this code to run?
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Did you look toward the top of the list? The VBE seems to have something akin to an MRU list for frequently-used references. Otherwise, they're in alpha order.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,988
Members
448,538
Latest member
alex78

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