Exit(0) And Exit(1) Function in Application Engine.

本文详细解释了PeopleCode中Exit函数的两种用法:Exit(0)用于终止当前PeopleCode Action,而Exit(1)则用于终止当前步骤。这对于理解应用引擎中的流程控制至关重要。
 
 Exit(0) – Terminates the current PeopleCode Action in application engine.

Exit(1) – Terminates the current Step in application engine.

转载于:https://www.cnblogs.com/bryanchen/p/3389748.html

帮我把这三个代码合成一个代码,执行先后顺序就是代码1,2,3。代码1:Public wbName Sub AR() Set sht = ActiveWorkbook.ActiveSheet wbName = ActiveWorkbook.Name ShtName = ActiveSheet.Name PathName = ThisWorkbook.Path MacroWbName = ThisWorkbook.Name 'Datefrom = sht.Range("C2").Value 'Dateto = sht.Range("D2").Value DataShtName = "WIP DN" filePath = “C:\TEMP\EXPORT.XLSX” If Dir(filePath) <> “” Then Kill filePath End If '连接SAP,运行Tcode*************** Call SAPConnection_Chk(“ZPM022”) '调用SAP连接 If ConnectingStatus = False Then Exit Sub End If Set Sbar = session.findById(“wnd[0]/sbar”) If InStr(1, Sbar.Text, “You are not authorized”) > 0 Then AppActivate (wbName) MsgBox "Please Check: " & Sbar.Text Exit Sub End If '执行SAP************************ 'Sheets(Input”).Select 'Range(“A2”).Select 'Range(Selection, Selection.End(xlDown)).Select 'Selection.Copy Application.ScreenUpdating = True Application.WindowState = xlMinimized session.findById(“wnd[0]/tbar[0]/okcd”).Text = “zpm022” session.findById(“wnd[0]”).sendVKey 0 session.findById(“wnd[0]/tbar[1]/btn[8]”).press session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).currentCellColumn = “QMNUM” session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).contextMenu session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).selectContextMenuItem “&XXL” session.findById(“wnd[1]/tbar[0]/btn[0]”).press session.findById(“wnd[1]/tbar[0]/btn[11]”).press '??layout************************ 'Call layoutfilter(“/WBS”) '??Layout?? 'If LayoutStatus = False Then ’ Exit Sub 'End If '??spreedsheet???************************ 'Call Spreedsheet '??spreedsheet??? '??local file???************************ 'Call LocalFile(“C:\Users\CNLIXU21\Desktop”, “789.xls”) '??local file??? wait 3 Windows(MacroWbName).Activate 'AppActivate (“Data.xlsm”) Worksheets(DataShtName).Activate If ActiveSheet.AutoFilterMode = True Then Cells.AutoFilter Range(“A1:Q2000).Clear Workbooks(“EXPORT.XLSX”).Activate Range(“A1).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select ’ Range(Selection, Selection.End(xlDown)).Select 'Range(Selection, Selection.End(xlUp)).Select Selection.Copy Workbooks(MacroWbName).Activate Worksheets(DataShtName).Activate Range(“A1).Select 'Range(“A” & Cells(Rows.Count, 1).End(xlUp).Row + 1).Select ActiveSheet.Paste Columns(“G:G”).Select Selection.TextToColumns Destination:=Range(“G1), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Selection.NumberFormat = “General” With Selection .HorizontalAlignment = xlLeft .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Columns(“J:J”).Select Selection.TextToColumns Destination:=Range(“J1), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _ :=“,”, FieldInfo:=Array(Array(1, 1), Array(2, 9)), TrailingMinusNumbers:=True Workbooks(“EXPORT.XLSX”).Activate Application.CutCopyMode = False ActiveWorkbook.Close SaveChanges:=False '************** Set sht = ActiveWorkbook.ActiveSheet wbName = ActiveWorkbook.Name ShtName = ActiveSheet.Name PathName = ThisWorkbook.Path MacroWbName = ThisWorkbook.Name 'Datefrom = sht.Range("C2").Value 'Dateto = sht.Range("D2").Value DataShtName = "WIP DR" filePath = “C:\TEMP\EXPORT.XLSX” If Dir(filePath) <> “” Then Kill filePath End If '连接SAP,运行Tcode*************** Call SAPConnection_Chk(“ZDNDR003”) '调用SAP连接 If ConnectingStatus = False Then Exit Sub End If Set Sbar = session.findById(“wnd[0]/sbar”) If InStr(1, Sbar.Text, “You are not authorized”) > 0 Then AppActivate (wbName) MsgBox "Please Check: " & Sbar.Text Exit Sub End If '执行SAP************************ 'Windows(MacroWbName).Activate 'Sheets(“VBA”).Select 'Range(“A2”).Select 'Range(Selection, Selection.End(xlDown)).Select 'Selection.Copy Application.ScreenUpdating = True Application.WindowState = xlMinimized session.findById(“wnd[0]/tbar[0]/okcd”).Text = “ZDNDR003” session.findById(“wnd[0]”).sendVKey 0 session.findById(“wnd[0]/usr/ctxtS_VBELN-LOW”).SetFocus session.findById(“wnd[0]/usr/ctxtS_VBELN-LOW”).caretPosition = 0 session.findById(“wnd[0]/usr/btn%S_VBELN%APP%-VALU_PUSH”).press session.findById(“wnd[1]/tbar[0]/btn[24]”).press session.findById(“wnd[1]/tbar[0]/btn[8]”).press session.findById(“wnd[0]/tbar[1]/btn[8]”).press session.findById(“wnd[0]”).sendVKey 33 session.findById(“wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell”).setCurrentCell 5, “TEXT” session.findById(“wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell”).selectedRows = “5” session.findById(“wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell”).clickCurrentCell session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).currentCellColumn = “ZZMATNR” session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).SelectAll session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).contextMenu session.findById(“wnd[0]/usr/cntlGRID1/shellcont/shell”).selectContextMenuItem “&XXL” session.findById(“wnd[1]/tbar[0]/btn[0]”).press session.findById(“wnd[1]/tbar[0]/btn[11]”).press '??layout************************ 'Call layoutfilter(“/WBS”) '??Layout?? 'If LayoutStatus = False Then ’ Exit Sub 'End If '??spreedsheet???************************ 'Call Spreedsheet '??spreedsheet??? '??local file???************************ 'Call LocalFile(“C:\Users\CNLIXU21\Desktop”, “789.xls”) '??local file??? wait 3 Windows(MacroWbName).Activate 'AppActivate (“LPG OCF Forecast.xlsm”) Worksheets(DataShtName).Activate If ActiveSheet.AutoFilterMode = True Then Cells.AutoFilter Range(“A1:BK6666”).Clear Workbooks(“EXPORT.XLSX”).Activate Range(“A1).Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select ’ Range(Selection, Selection.End(xlDown)).Select 'Range(Selection, Selection.End(xlUp)).Select Selection.Copy Workbooks(MacroWbName).Activate Worksheets(DataShtName).Activate Range(“A1).Select 'Range(“A” & Cells(Rows.Count, 1).End(xlUp).Row + 1).Select ActiveSheet.Paste Columns(“A:A”).Select Selection.TextToColumns Destination:=Range(“A1), DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _ Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _ :=Array(1, 1), TrailingMinusNumbers:=True Selection.NumberFormat = “General” With Selection .HorizontalAlignment = xlLeft .WrapText = False .Orientation = 0 .AddIndent = False .IndentLevel = 0 .ShrinkToFit = False .ReadingOrder = xlContext .MergeCells = False End With Workbooks(“EXPORT.XLSX”).Activate Application.CutCopyMode = False ActiveWorkbook.Close SaveChanges:=False MsgBox “Done” End Sub Public Function wait(Second) Savetime = Timer While Timer < Savetime + Second DoEvents Wend End Function代码2:Sub ProcessExcelData_HighSpeed() ’ ??? On Error GoTo ErrorHandler Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Application.EnableEvents = False Application.StatusBar = "??????..." Dim startTime As Double: startTime = Timer Dim wb1 As Workbook, wb2 As Workbook Dim ws1 As Worksheet, ws2 As Worksheet Dim dict As Object, newDataDict As Object Dim dataArr As Variant, delRows() As Boolean Dim i As Long, k As Long, counter As Long Dim deleteCount1 As Long, deleteCount2 As Long, updateCount As Long Dim output As String ' ?????? Const PATH1 As String = "C:\Users\Skyler.zheng\OneDrive - Taikoo Engine Services (Xiamen) Company Limited\CR Planning\Inhouse repair control\VBA resource data\Data test.xlsm" Const PATH2 As String = "C:\Users\Skyler.zheng\OneDrive - Taikoo Engine Services (Xiamen) Company Limited\CR Planning\Inhouse repair control\new inhouse repair status.xlsm" ' ?????(????) Set wb1 = Workbooks.Open(PATH1, False, True) Set wb2 = Workbooks.Open(PATH2, False, True) Set ws1 = wb1.Sheets("ZPM008") Set ws2 = wb2.Sheets("All") ' ===== ??1 & 2: ??Excel1 ===== Dim lastRow1 As Long lastRow1 = ws1.Cells(ws1.Rows.Count, "J").End(xlUp).Row dataArr = ws1.Range("A2:J" & lastRow1).Value ' ????????(??Boolean??) ReDim delRows(1 To UBound(dataArr, 1)) As Boolean deleteCount1 = 0 ' ????????? For i = 1 To UBound(dataArr, 1) ' ??1: J?????? If CStr(dataArr(i, 10)) = "HPT STG2 NOZZLE DUMMY ASSY" Then delRows(i) = True deleteCount1 = deleteCount1 + 1 ' ??2: D???5000 ElseIf IsNumeric(dataArr(i, 4)) Then If dataArr(i, 4) > 5000 Then delRows(i) = True deleteCount1 = deleteCount1 + 1 End If End If Next i ' ???????(????:?????) If deleteCount1 > 0 Then Dim newArr() As Variant, idx As Long ReDim newArr(1 To UBound(dataArr, 1) - deleteCount1, 1 To UBound(dataArr, 2)) idx = 0 For i = 1 To UBound(dataArr, 1) If Not delRows(i) Then idx = idx + 1 For k = 1 To UBound(dataArr, 2) newArr(idx, k) = dataArr(i, k) Next k End If Next i ' ???? ws1.Range("A2").Resize(UBound(newArr, 1), UBound(newArr, 2)).Value = newArr End If ' ===== ??3: ??????? ===== Set dict = CreateObject("Scripting.Dictionary") Set newDataDict = CreateObject("Scripting.Dictionary") dict.CompareMode = vbTextCompare ' ????Excel1?F???(??????????) lastRow1 = ws1.Cells(ws1.Rows.Count, "F").End(xlUp).Row dataArr = ws1.Range("F2:F" & lastRow1).Value For i = 1 To UBound(dataArr, 1) If Not IsEmpty(dataArr(i, 1)) Then dict(CStr(dataArr(i, 1))) = 1 End If Next i ' ??Excel2?A??? Dim lastRow2 As Long lastRow2 = ws2.Cells(ws2.Rows.Count, "A").End(xlUp).Row dataArr = ws2.Range("A2:A" & lastRow2).Value ' ?????? deleteCount2 = 0 updateCount = 0 ReDim delRows(1 To UBound(dataArr, 1)) As Boolean ' ??????? For i = 1 To UBound(dataArr, 1) If Not IsEmpty(dataArr(i, 1)) Then Dim cellValue As String cellValue = CStr(dataArr(i, 1)) If dict.Exists(cellValue) Then newDataDict(cellValue) = 1 Else delRows(i) = True deleteCount2 = deleteCount2 + 1 End If End If Next i ' ?????(????) If deleteCount2 > 0 Then counter = 0 For i = UBound(delRows) To 1 Step -1 If delRows(i) Then ws2.Rows(i + 1).Delete ' ??:????2???,???+1 counter = counter + 1 If counter Mod 500 = 0 Then Application.StatusBar = "????Excel2?: " & counter & "/" & deleteCount2 DoEvents End If End If Next i End If ' ????? lastRow2 = ws2.Cells(ws2.Rows.Count, "A").End(xlUp).Row Dim newData() As Variant ReDim newData(1 To dict.Count, 1 To 1) counter = 0 ' ????????? Dim key As Variant For Each key In dict.Keys If Not newDataDict.Exists(key) Then counter = counter + 1 newData(counter, 1) = key End If Next key ' ????? If counter > 0 Then ws2.Cells(lastRow2 + 1, 1).Resize(counter, 1).Value = newData updateCount = counter End If ' ???? wb1.Save wb2.Save Cleanup: ’ ??Excel?? Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic Application.EnableEvents = True Application.StatusBar = False ' ???? Dim execTime As String execTime = Format(Timer - startTime, "0.00") MsgBox "? ????!?? " & execTime & " ?" & vbCrLf & _ "Excel1 ????: " & deleteCount1 & vbCrLf & _ "Excel2 ????: " & deleteCount2 & vbCrLf & _ "Excel2 ????: " & updateCount, _ vbInformation, "????" Exit Sub ErrorHandler: MsgBox "?? " & Err.Number & ": " & Err.Description & vbCrLf & _ "??? " & Erl, vbCritical, “VBA???” Resume Cleanup End Sub 代码3:Sub UpdateInhouseRepairStatus() Application.ScreenUpdating = False Application.Calculation = xlCalculationManual Application.EnableEvents = False Dim wsAll As Worksheet, wsZPM008 As Worksheet, wsWIPDN As Worksheet, wsWIPDR As Worksheet Dim wbData As Workbook Dim lastRowAll As Long, lastRowZPM008 As Long, lastRowWIPDN As Long, lastRowWIPDR As Long Dim dictZPM008 As Object, dictWIPDN As Object, dictWIPDR As Object Dim i As Long, matchRow As Long Dim key As String, keyDN As String, keyDR As String Dim startTime As Double startTime = Timer On Error GoTo ErrorHandler ' Initialize dictionaries for fast lookup Set dictZPM008 = CreateObject("Scripting.Dictionary") Set dictWIPDN = CreateObject("Scripting.Dictionary") Set dictWIPDR = CreateObject("Scripting.Dictionary") ' Set reference to current workbook sheets Set wsAll = ThisWorkbook.Sheets("All") ' Open Data workbook Set wbData = Workbooks.Open("C:\Users\Skyler.zheng\OneDrive - Taikoo Engine Services (Xiamen) Company Limited\CR Planning\Inhouse repair control\VBA resource data\Data test.xlsm", False, True) ' Set reference to Data workbook sheets Set wsZPM008 = wbData.Sheets("ZPM008") Set wsWIPDN = wbData.Sheets("WIP DN") Set wsWIPDR = wbData.Sheets("WIP DR") ' Get last rows lastRowAll = wsAll.Cells(wsAll.Rows.Count, "A").End(xlUp).Row lastRowZPM008 = wsZPM008.Cells(wsZPM008.Rows.Count, "F").End(xlUp).Row lastRowWIPDN = wsWIPDN.Cells(wsWIPDN.Rows.Count, "G").End(xlUp).Row lastRowWIPDR = wsWIPDR.Cells(wsWIPDR.Rows.Count, "H").End(xlUp).Row ' Build dictionary for ZPM008 (F column as key, row number as value) For i = 2 To lastRowZPM008 If Not IsEmpty(wsZPM008.Cells(i, "F").Value) Then dictZPM008(CStr(wsZPM008.Cells(i, "F").Value)) = i End If Next i ' Build dictionary for WIP DN (G&J concatenated as key, B column as value) For i = 2 To lastRowWIPDN keyDN = CStr(wsWIPDN.Cells(i, "G").Value) & "|" & CStr(wsWIPDN.Cells(i, "J").Value) dictWIPDN(keyDN) = wsWIPDN.Cells(i, "B").Value Next i ' Build dictionary for WIP DR (H&J concatenated as key, A column as value) For i = 2 To lastRowWIPDR keyDR = CStr(wsWIPDR.Cells(i, "A").Value) & "|" & CStr(wsWIPDR.Cells(i, "C").Value) dictWIPDR(keyDR) = wsWIPDR.Cells(i, "I").Value Next i ' Process data in sheet All For i = 2 To lastRowAll ' Task 1: Update B,D,E,F,H,I,W,J columns from ZPM008 key = CStr(wsAll.Cells(i, "A").Value) If dictZPM008.Exists(key) Then matchRow = dictZPM008(key) wsAll.Cells(i, "B").Value = wsZPM008.Cells(matchRow, "L").Value wsAll.Cells(i, "D").Value = wsZPM008.Cells(matchRow, "E").Value wsAll.Cells(i, "E").Value = wsZPM008.Cells(matchRow, "D").Value wsAll.Cells(i, "F").Value = wsZPM008.Cells(matchRow, "J").Value wsAll.Cells(i, "H").Value = wsZPM008.Cells(matchRow, "R").Value wsAll.Cells(i, "I").Value = wsZPM008.Cells(matchRow, "S").Value wsAll.Cells(i, "W").Value = wsZPM008.Cells(matchRow, "Y").Value wsAll.Cells(i, "J").Value = wsZPM008.Cells(matchRow, "P").Value wsAll.Cells(i, "G").Value = wsZPM008.Cells(matchRow, "I").Value End If ' Task 2: Update N column DN NO. from WIP DN If Not IsEmpty(wsAll.Cells(i, "E").Value) And Not IsEmpty(wsAll.Cells(i, "G").Value) Then keyDN = CStr(wsAll.Cells(i, "E").Value) & "|" & CStr(wsAll.Cells(i, "G").Value) If dictWIPDN.Exists(keyDN) Then wsAll.Cells(i, "N").Value = dictWIPDN(keyDN) End If End If ' Task 3: Update U column DN CREATE DATE from WIP DN (using N column) If Not IsEmpty(wsAll.Cells(i, "N").Value) Then ' Need to build another dictionary for WIP DN B to O mapping ' This could be optimized further if needed For matchRow = 2 To lastRowWIPDN If wsWIPDN.Cells(matchRow, "B").Value = wsAll.Cells(i, "N").Value Then wsAll.Cells(i, "U").Value = wsWIPDN.Cells(matchRow, "O").Value Exit For End If Next matchRow End If ' Task 4: Update O column DR NO. from WIP DR If Not IsEmpty(wsAll.Cells(i, "E").Value) And Not IsEmpty(wsAll.Cells(i, "G").Value) Then keyDR = CStr(wsAll.Cells(i, "E").Value) & "|" & CStr(wsAll.Cells(i, "G").Value) If dictWIPDR.Exists(keyDR) Then wsAll.Cells(i, "O").Value = dictWIPDR(keyDR) End If End If ' Update Q,R,S columns from WIP DR (using O column) If Not IsEmpty(wsAll.Cells(i, "O").Value) Then ' Need to build another dictionary for WIP DR A to N,O,P mapping ' This could be optimized further if needed For matchRow = 2 To lastRowWIPDR If wsWIPDR.Cells(matchRow, "I").Value = wsAll.Cells(i, "O").Value Then wsAll.Cells(i, "Q").Value = wsWIPDR.Cells(matchRow, "L").Value 'DR COMMIT DATE wsAll.Cells(i, "R").Value = wsWIPDR.Cells(matchRow, "K").Value 'FINAL SOLUTION DATE wsAll.Cells(i, "S").Value = wsWIPDR.Cells(matchRow, "N").Value 'CUSTOMER CONFIRM DATE Exit For End If Next matchRow End If Next i wbData.Close False Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic Application.EnableEvents = True MsgBox "Update completed successfully in " & Format(Timer - startTime, "0.00") & " seconds", vbInformation Exit Sub ErrorHandler: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic Application.EnableEvents = True If Not wbData Is Nothing Then wbData.Close False MsgBox "Error " & Err.Number & ": " & Err.Description, vbCritical End Sub
09-27
给我优化这个表格VBA的运行速度te Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Dim filePath As String Dim wb1 As Workbook, wb2 As Workbook Dim ws1 As Worksheet, ws2 As Worksheet Dim keyword1 As Variant, keyword2 As Variant Dim lastRow As Long, visibleRows As Long If Target.Column = 3 And Target.Row > 1 Then Cancel = True keyword1 = Target.Value keyword2 = Cells(Target.Row, 1).Value If IsEmpty(keyword1) Or IsEmpty(keyword2) Then MsgBox "所选单元格内容不能为空!", vbExclamation Exit Sub End If ' path filePath = "C:\Users\Skyler.zheng\OneDrive - Taikoo Engine Services (Xiamen) Company Limited\Excel Version\SO list-Brg.xlsm" On Error Resume Next Dim localPath As String localPath = GetLocalFilePath(filePath) If localPath = "" Then localPath = filePath End If On Error GoTo 0 ' 打开表格2 Application.ScreenUpdating = False Application.DisplayAlerts = False On Error GoTo ErrorHandler ' 尝试打开工作簿 Set wb2 = Workbooks.Open(localPath, ReadOnly:=True) Set ws2 = wb2.Sheets("ZEGST001") ' 清除现有筛选 If ws2.AutoFilterMode Then ws2.AutoFilterMode = False End If ' 获取表格2的最后一行 lastRow = ws2.Cells(ws2.Rows.Count, 1).End(xlUp).Row ' 设置筛选条件 ws2.Range("A1").AutoFilter ' 筛选B列(与表格1的F列匹配) ws2.Range("A1").AutoFilter Field:=2, Criteria1:=keyword1 ' 筛选D列(与表格1的A列匹配) ws2.Range("A1").AutoFilter Field:=4, Criteria1:=keyword2 ' 检查是否有匹配的记录 On Error Resume Next visibleRows = ws2.Range("B2:B" & lastRow).SpecialCells(xlCellTypeVisible).Cells.Count On Error GoTo ErrorHandler If visibleRows > 0 Then ' 找到匹配记录,跳转到表格2并选中第一条记录 Dim firstVisibleRow As Long For firstVisibleRow = 2 To lastRow If Not ws2.Rows(firstVisibleRow).Hidden Then ws2.Rows(firstVisibleRow).Select ws2.Activate Exit For End If Next firstVisibleRow Else ' 未找到匹配记录,关闭表格2并提示 wb2.Close SaveChanges:=False MsgBox "No data", vbInformation End If CleanUp: Application.DisplayAlerts = True Application.ScreenUpdating = True Exit Sub ErrorHandler: ' 错误处理:关闭已打开的工作簿并显示错误信息 If Not wb2 Is Nothing Then wb2.Close SaveChanges:=False End If MsgBox "处理过程中出现错误: " & Err.Description, vbCritical Resume CleanUp End If End Sub Function GetLocalFilePath(onedrivePath As String) As String ' 将OneDrive路径转换为本地路径 ' 注意:此函数可能无法处理所有情况,具体取决于OneDrive同步设置 On Error Resume Next ' 尝试解析URL获取文件名 Dim fileName As String Dim parts() As String parts = Split(onedrivePath, "/") fileName = parts(UBound(parts)) ' 获取OneDrive本地同步文件夹路径 Dim localOneDrivePath As String localOneDrivePath = Environ("USERPROFILE") & "\OneDrive\文档" ' 根据实际情况调整 ' 构建本地文件路径 GetLocalFilePath = localOneDrivePath & "\" & fileName ' 检查文件是否存在 If Dir(GetLocalFilePath) = "" Then GetLocalFilePath = "" ' 文件不存在,返回空字符串 End If On Error GoTo 0 End Function
07-25
INFO 07-06 22:09:23 __init__.py:207] Automatically detected platform cuda. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:23 multiproc_worker_utils.py:229] Worker ready; awaiting tasks (VllmWorkerProcess pid=10542) INFO 07-06 22:09:24 cuda.py:178] Cannot use FlashAttention-2 backend for Volta and Turing GPUs. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:24 cuda.py:226] Using XFormers backend. (VllmWorkerProcess pid=10542) INFO 07-06 22:09:25 utils.py:916] Found nccl from library libnccl.so.2 (VllmWorkerProcess pid=10542) INFO 07-06 22:09:25 pynccl.py:69] vLLM is using nccl==2.21.5 INFO 07-06 22:09:25 utils.py:916] Found nccl from library libnccl.so.2 INFO 07-06 22:09:25 pynccl.py:69] vLLM is using nccl==2.21.5 INFO 07-06 22:09:25 custom_all_reduce_utils.py:206] generating GPU P2P access cache in /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json INFO 07-06 22:09:39 custom_all_reduce_utils.py:244] reading GPU P2P access cache from /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json (VllmWorkerProcess pid=10542) INFO 07-06 22:09:39 custom_all_reduce_utils.py:244] reading GPU P2P access cache from /root/.cache/vllm/gpu_p2p_access_cache_for_0,1.json WARNING 07-06 22:09:39 custom_all_reduce.py:145] Custom allreduce is disabled because your platform lacks GPU P2P capability or P2P test failed. To silence this warning, specify disable_custom_all_reduce=True explicitly. (VllmWorkerProcess pid=10542) WARNING 07-06 22:09:39 custom_all_reduce.py:145] Custom allreduce is disabled because your platform lacks GPU P2P capability or P2P test failed. To silence this warning, specify disable_custom_all_reduce=True explicitly. INFO 07-06 22:09:39 shm_broadcast.py:258] vLLM message queue communication handle: Handle(connect_ip='127.0.0.1', local_reader_ranks=[1], buffer_handle=(1, 4194304, 6, 'psm_b99a0acb'), local_subscribe_port=57279, remote_subscribe_port=None) INFO 07-06 22:09:39 model_runner.py:1110] Starting to load model /home/user/Desktop/DeepSeek-R1-Distill-Qwen-32B... (VllmWorkerProcess pid=10542) INFO 07-06 22:09:39 model_runner.py:1110] Starting to load model /home/user/Desktop/DeepSeek-R1-Distill-Qwen-32B... ERROR 07-06 22:09:39 engine.py:400] CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) ERROR 07-06 22:09:39 engine.py:400] Traceback (most recent call last): ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 391, in run_mp_engine ERROR 07-06 22:09:39 engine.py:400] engine = MQLLMEngine.from_engine_args(engine_args=engine_args, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 124, in from_engine_args ERROR 07-06 22:09:39 engine.py:400] return cls(ipc_path=ipc_path, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 76, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.engine = LLMEngine(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 273, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.model_executor = executor_class(vllm_config=vllm_config, ) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 271, in __init__ ERROR 07-06 22:09:39 engine.py:400] super().__init__(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 52, in __init__ ERROR 07-06 22:09:39 engine.py:400] self._init_executor() ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 125, in _init_executor ERROR 07-06 22:09:39 engine.py:400] self._run_workers("load_model", ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 185, in _run_workers ERROR 07-06 22:09:39 engine.py:400] driver_worker_output = run_method(self.driver_worker, sent_method, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/utils.py", line 2196, in run_method ERROR 07-06 22:09:39 engine.py:400] return func(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/worker.py", line 183, in load_model ERROR 07-06 22:09:39 engine.py:400] self.model_runner.load_model() ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/model_runner.py", line 1112, in load_model ERROR 07-06 22:09:39 engine.py:400] self.model = get_model(vllm_config=self.vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/__init__.py", line 14, in get_model ERROR 07-06 22:09:39 engine.py:400] return loader.load_model(vllm_config=vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 406, in load_model ERROR 07-06 22:09:39 engine.py:400] model = _initialize_model(vllm_config=vllm_config) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 125, in _initialize_model ERROR 07-06 22:09:39 engine.py:400] return model_class(vllm_config=vllm_config, prefix=prefix) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 453, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.model = Qwen2Model(vllm_config=vllm_config, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/compilation/decorators.py", line 151, in __init__ ERROR 07-06 22:09:39 engine.py:400] old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs) ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 307, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.start_layer, self.end_layer, self.layers = make_layers( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 557, in make_layers ERROR 07-06 22:09:39 engine.py:400] [PPMissingLayer() for _ in range(start_layer)] + [ ERROR 07-06 22:09:39 engine.py:400] ^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 558, in <listcomp> ERROR 07-06 22:09:39 engine.py:400] maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}")) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 309, in <lambda> ERROR 07-06 22:09:39 engine.py:400] lambda prefix: Qwen2DecoderLayer(config=config, ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 220, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.mlp = Qwen2MLP( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 82, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.down_proj = RowParallelLinear( ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 1062, in __init__ ERROR 07-06 22:09:39 engine.py:400] self.quant_method.create_weights( ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 129, in create_weights ERROR 07-06 22:09:39 engine.py:400] weight = Parameter(torch.empty(sum(output_partition_sizes), ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/torch/utils/_device.py", line 106, in __torch_function__ ERROR 07-06 22:09:39 engine.py:400] return func(*args, **kwargs) ERROR 07-06 22:09:39 engine.py:400] ^^^^^^^^^^^^^^^^^^^^^ ERROR 07-06 22:09:39 engine.py:400] torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) Process SpawnProcess-1: INFO 07-06 22:09:39 multiproc_worker_utils.py:128] Killing local vLLM worker processes Traceback (most recent call last): File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 402, in run_mp_engine raise e File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 391, in run_mp_engine engine = MQLLMEngine.from_engine_args(engine_args=engine_args, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 124, in from_engine_args return cls(ipc_path=ipc_path, ^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/multiprocessing/engine.py", line 76, in __init__ self.engine = LLMEngine(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/engine/llm_engine.py", line 273, in __init__ self.model_executor = executor_class(vllm_config=vllm_config, ) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 271, in __init__ super().__init__(*args, **kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/executor_base.py", line 52, in __init__ self._init_executor() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 125, in _init_executor self._run_workers("load_model", File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/executor/mp_distributed_executor.py", line 185, in _run_workers driver_worker_output = run_method(self.driver_worker, sent_method, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/utils.py", line 2196, in run_method return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/worker.py", line 183, in load_model self.model_runner.load_model() File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/worker/model_runner.py", line 1112, in load_model self.model = get_model(vllm_config=self.vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/__init__.py", line 14, in get_model return loader.load_model(vllm_config=vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 406, in load_model model = _initialize_model(vllm_config=vllm_config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/model_loader/loader.py", line 125, in _initialize_model return model_class(vllm_config=vllm_config, prefix=prefix) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 453, in __init__ self.model = Qwen2Model(vllm_config=vllm_config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/compilation/decorators.py", line 151, in __init__ old_init(self, vllm_config=vllm_config, prefix=prefix, **kwargs) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 307, in __init__ self.start_layer, self.end_layer, self.layers = make_layers( ^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 557, in make_layers [PPMissingLayer() for _ in range(start_layer)] + [ ^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/utils.py", line 558, in <listcomp> maybe_offload_to_cpu(layer_fn(prefix=f"{prefix}.{idx}")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 309, in <lambda> lambda prefix: Qwen2DecoderLayer(config=config, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 220, in __init__ self.mlp = Qwen2MLP( ^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/models/qwen2.py", line 82, in __init__ self.down_proj = RowParallelLinear( ^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 1062, in __init__ self.quant_method.create_weights( File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/model_executor/layers/linear.py", line 129, in create_weights weight = Parameter(torch.empty(sum(output_partition_sizes), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/torch/utils/_device.py", line 106, in __torch_function__ return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 136.00 MiB. GPU 0 has a total capacity of 21.49 GiB of which 43.50 MiB is free. Including non-PyTorch memory, this process has 21.44 GiB memory in use. Of the allocated memory 21.19 GiB is allocated by PyTorch, and 20.25 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) [rank0]:[W706 22:09:40.345098611 ProcessGroupNCCL.cpp:1250] Warning: WARNING: process group has NOT been destroyed before we destruct ProcessGroupNCCL. On normal program exit, the application should call destroy_process_group to ensure that any pending NCCL operations have finished in this process. In rare cases this process can exit before this point and block the progress of another member of the process group. This constraint has always been present, but this warning has only been added since PyTorch 2.4 (function operator()) Traceback (most recent call last): File "/root/miniconda3/envs/deepseek_vllm/bin/vllm", line 8, in <module> sys.exit(main()) ^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/cli/main.py", line 73, in main args.dispatch_function(args) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/cli/serve.py", line 34, in cmd uvloop.run(run_server(args)) File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/uvloop/__init__.py", line 105, in run return runner.run(wrapper()) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "uvloop/loop.pyx", line 1518, in uvloop.loop.Loop.run_until_complete File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/uvloop/__init__.py", line 61, in wrapper return await main ^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 947, in run_server async with build_async_engine_client(args) as engine_client: File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 139, in build_async_engine_client async with build_async_engine_client_from_engine_args( File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/contextlib.py", line 210, in __aenter__ return await anext(self.gen) ^^^^^^^^^^^^^^^^^^^^^ File "/root/miniconda3/envs/deepseek_vllm/lib/python3.11/site-packages/vllm/entrypoints/openai/api_server.py", line 233, in build_async_engine_client_from_engine_args raise RuntimeError( RuntimeError: Engine process failed to start. See stack trace for the root cause. (deepseek_vllm) root@user-X99:/home/user/Desktop# /root/miniconda3/envs/deepseek_vllm/lib/python3.11/multiprocessing/resource_tracker.py:254: UserWarning: resource_tracker: There appear to be 1 leaked shared_memory objects to clean up at shutdown warnings.warn('resource_tracker: There appear to be %d ' (deepseek_vllm) root@user-X99:/home/user/Desktop#
07-07
在表格中,编写VBA实现: 在sheet“WIP Engine list”,只要我双击CDF列的任一单元格就自动复制b2单元格的数值并且跳转到SAP的tcode:ZPM008。目前我已经有个类似的代码,供参考。thisworkbook代码:Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) ' check if double clik B2/C2/D2 If Not Intersect(Target, Union(Sh.Range("B2"), Sh.Range("C2"), Sh.Range("D2"))) Is Nothing Then Cancel = True ' cancel edit function Dim cellValue As String cellValue = Target.Value ' check if valve is "" If cellValue = "" Then Exit Sub ' bu yao tan chuan ProcessSAP_ZPM008 cellValue End If End Sub 模块代码:Public Function ProcessSAP_ZPM008(ByVal inputValue As String) As Boolean On Error GoTo ErrorHandler ' 1. connect SAP Dim SapGuiAuto As Object, application As Object, connection As Object, session As Object Set SapGuiAuto = GetObject("SAPGUI") Set application = SapGuiAuto.GetScriptingEngine Set connection = application.Children(0) Set session = connection.Children(0) ' 2. go to ZPM008 session.StartTransaction "ZPM008" session.findById("wnd[0]").maximize ' 3. input SO session.findById("wnd[0]/usr/ctxtS_KDAUF-LOW").Text = inputValue session.findById("wnd[0]/usr/ctxtS_KDAUF-LOW").SetFocus ' 4. serach session.findById("wnd[0]").sendVKey 8 ' 5. cheng gong bu yao tan chuan ProcessSAP_ZPM008 = True Exit Function ErrorHandler: ' cuo wu bu yao tan chuan Debug.Print "SAP ???????: " & Err.Description ProcessSAP_ZPM008 = False End Function
08-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值