From 2454478c65f1495f6c59da0d783396d9a9607568 Mon Sep 17 00:00:00 2001 From: Kenichiro NOGI Date: Fri, 11 Sep 2026 13:34:35 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20run()=E3=82=92Export/Get=E5=88=86?= =?UTF-8?q?=E5=B2=90=E3=83=95=E3=83=AD=E3=83=BC=E5=8C=96=E3=81=97=E5=87=A6?= =?UTF-8?q?=E7=90=86=E6=99=82=E9=96=93=E8=A8=88=E6=B8=AC(D4-D6)=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vba-files/Module/Module1.bas | 56 ++++++++++++++----- 1 file changed, 41 insertions(+), 15 deletions(-) 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