I have the following code:
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?
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?