Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel VBA PUT Json_Json_Excel_Vba - Fatal编程技术网

Excel VBA PUT Json

Excel VBA PUT Json,json,excel,vba,Json,Excel,Vba,我现在怎样才能使它工作?我试图从Y列(rng1)和Z列(rng2)中获取值 我认为您需要使用offset来获取相邻的值,因此只需要一个循环。并使用和连接字符串 With ThisWorkbook.Worksheets("Fulcrum Upload") For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible) If Not

我现在怎样才能使它工作?我试图从Y列(rng1)和Z列(rng2)中获取值


我认为您需要使用offset来获取相邻的值,因此只需要一个循环。并使用
连接字符串

With ThisWorkbook.Worksheets("Fulcrum Upload")
    For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible)
            If Not IsEmpty(rng1) Then
                With xhr
                    .Open "PUT", "https://api.fulcrumapp.com/api/v2/records/" & rng1.Offset(, 1).Value & ".json", False
                    .setRequestHeader "Accept", "application/json"
                    .setRequestHeader "Content-type", "application/json"
                    .setRequestHeader "X-ApiToken", "11111111"
                    .send rng1.Value
                End With
            End If
        Next
    End With
End Sub

令人惊叹的!很好用!
With ThisWorkbook.Worksheets("Fulcrum Upload")
    For Each rng1 In .Range("Y3:Y" & .Cells(.Rows.Count, "Y").End(xlUp).Row).SpecialCells(xlVisible)
            If Not IsEmpty(rng1) Then
                With xhr
                    .Open "PUT", "https://api.fulcrumapp.com/api/v2/records/" & rng1.Offset(, 1).Value & ".json", False
                    .setRequestHeader "Accept", "application/json"
                    .setRequestHeader "Content-type", "application/json"
                    .setRequestHeader "X-ApiToken", "11111111"
                    .send rng1.Value
                End With
            End If
        Next
    End With
End Sub