diff --git a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas index 81d27514..90200c20 100644 --- a/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas +++ b/XVBA/新版着工要因閲覧シート/vba-files/Module/Module1.bas @@ -23,35 +23,61 @@ Sub run() ' Call init + defaultSh.Range("D4").Value = Now defaultSh.Range("D3").Value = "捞..." Application.ScreenUpdating = False 'ʍXV~ Application.Calculation = xlManual 'vZ~ '------------------------------------------ Debug.Print "Jn" - 'CSVf[^擾 - Dim resData As Variant - - Debug.Print "f[^擾Jn" - 'e[uCSVf[^擾 - resData = exportCSVData(tableId) - - 'resDatȁꍇ̓XLbv - If IsEmpty(resData) Or resData = "" Then - Debug.Print "f[^擾ł܂ł" - Else - 'CSVf[^V[gɏo - Call exportCSVDataToSheet(resData, tableId) - End If - + Select Case fetchMethod + Case "Get" + Call runGetFlow + Case Else + Call runExportFlow + End Select Debug.Print "I" '------------------------------------------ Application.Calculation = xlAutomatic 'vZĊJ Application.ScreenUpdating = True 'ʍXVĊJ + defaultSh.Range("D5").Value = Now + defaultSh.Range("D6").Value = (defaultSh.Range("D5").Value - defaultSh.Range("D4").Value) * 86400 defaultSh.Range("D3").Value = "捞" End Sub +'****************************************************************************** +'ExportiCSVS擾jł̃f[^捞 +Sub runExportFlow() + Dim resData As Variant + + Debug.Print "f[^擾JniExportj" + resData = exportCSVData(tableId) + + If IsEmpty(resData) Or resData = "" Then + Debug.Print "f[^擾ł܂ł" + Else + Call exportCSVDataToSheet(resData, tableId) + End If +End Sub + +'****************************************************************************** +'Getiapi-record-get-multijł̃f[^捞 +Sub runGetFlow() + Dim records As Collection + + Debug.Print "f[^擾JniGetj" + Set records = getRecordsData(tableId) + + If records Is Nothing Then + Debug.Print "f[^擾ł܂ł" + ElseIf records.count = 0 Then + Debug.Print "f[^擾ł܂ł" + Else + Call getRecordsDataToSheet(records, tableId) + End If +End Sub + '****************************************************************************** 'CSVf[^擾 Function exportCSVData(tableId As String) As Variant