YasserKhalil
Well-Known Member
Hello everyone
With the awesome help of Mr. Marc before I could adopt the following code to make it working
	
	
	
		
This code is grabbing dropbox files from the folder and subfolders
and it is working with the current URL but doesn't work for the following URL
	
	
	
		
Any help in this issue please
				
			With the awesome help of Mr. Marc before I could adopt the following code to make it working
		Code:
	
	Const url As String = "https://www.dropbox.com/sh/v4zcawgs32v7qc9/AAALfDRjpNOT8NnOTL_4XAXja?dl=0"
Sub Grab_All_DropBox_URLs_In_Main_Folder_And_SubFolders()
    Dim v          As Variant
    Dim y          As Variant
    Dim n          As Long
    Dim p          As Long
    Dim r          As Long
    Application.ScreenUpdating = False
        With CreateObject("WinHttp.WinHttpRequest.5.1")
            .Open "GET", url, False
            .setRequestHeader "DNT", "1"
            On Error Resume Next
                .send
                If .Status = 200 Then v = Split(.responseText, """filename"": """)
            On Error GoTo 0
        End With
   
        If IsArray(v) Then
            For n = 1 To UBound(v) - 1
                If InStr(Split(v(n), """")(0), ".") = 0 Then
                    With CreateObject("WinHttp.WinHttpRequest.5.1")
                        .Open "GET", Split(Split(v(n), """href"": """)(1), """")(0), False
                        .setRequestHeader "DNT", "1"
                        On Error Resume Next
                            .send
                            If .Status = 200 Then y = Split(.responseText, """filename"": """)
                        On Error GoTo 0
                    End With
   
                    If IsArray(y) Then
                        For p = 1 To UBound(y) - 1
                            r = r + 1
                            Cells(r, 1).Value = Split(y(p), """")(0)
                            Cells(r, 2).Value = Split(Split(y(p), """href"": """)(1), """")(0)
                        Next p
                    End If
                Else
                    r = r + 1
                    Cells(r, 1).Value = Split(v(n), """")(0)
                    Cells(r, 2).Value = Split(Split(v(n), """href"": """)(1), """")(0)
                End If
            Next n
        End If
    Application.ScreenUpdating = True
End Sub
	This code is grabbing dropbox files from the folder and subfolders
and it is working with the current URL but doesn't work for the following URL
		Code:
	
	Const url As String = "https://www.dropbox.com/sh/47uje0uvl2sulo2/AABS_TUqqwK3oYwnbcN6Gj4Fa?dl=0"
	Any help in this issue please