hi, expert i have folder calls cus and contains many sub folders cc1,cc2,cc3 each folder contains files types pdf or xls it supposes copying folder's name in col a and file's name in col b so i search in the internet to do that i got this code but not works it gives me error about function nod defined
Private Sub ProcessFolder(fso As FileSystemObject, xFolder As Folder)
HTML Code:
Sub Get_MAIN_File_Names()   
 Dim fso As FileSystemObject    
Dim xDirect As String    
Dim xRootFolder As Folder   
 Dim DrawingNumb As String    
Dim RevNumb As String   
 Dim rootFolderStr As String
    Set fso = New FileSystemObject   
 xRow = 0    

With Application.FileDialog(msoFileDialogFolderPicker)      
 .Title = "Select Main File"       
.Show
       'PROCESS ROOT FOLDER      
 If .SelectedItems.Count <> 0 Then         
 xDirect = .SelectedItems(1) & "\"         
 Set xRootFolder = fso.GetFolder(xDirect)         
 ProcessFolder fso, xRootFolder       End If
    End With
End Sub
Private Sub ProcessFolder(fso As FileSystemObject, xFolder As Folder)   
 Dim xFiles As Files    
Dim xFile As File    
Dim xSubFolders As Folders  
  Dim xSubFolder As Folder    
Dim xSubFolderName As String   
 Dim xFileName As String    
Dim xFileTime As String
    Set xFiles = xFolder.Files    'Adding Column names    
Cells(1, "A").Value = "SubFolder Name"    
Cells(1, "B").Value = "File Name"    
Cells(1, "C").Value = "Modified Date/Time"
    For Each xSubFolder In xSubFolders  
 xSubFolderName = xSubFolder.Name   
ActiveCell.Offset(xRow, 0) = xSubFolderName   
xRow = xRow + 1
Next xSubFolder
    'LOOPS THROUGH EACH FILE NAME IN FOLDER  
  For Each xFile In xFiles
      'EXTRACT INFORMATION FROM FILE NAME     
  xFileName = xFile.Name      
 xFileTime = xFile.DateLastModified
      'INSERT INFO INTO EXCEL       
.Offset(xRow, 1) = xFileName       
ActiveCell.Offset(xRow, 2) = xFileTime     
  xRow = xRow + 1   

 Next xFile
    Set xSubFolders = xFolder.SubFolders    

For Each xSubFolder In xSubFolders       
 ProcessFolder fso, xSubFolder   
 Next xSubFolder
End Sub