我现在正在使用 xlwings ,并且在运行VBA代码以连接到Python时遇到问题。我遇到错误消息:Run-time error '6': flow
,它在以下行中断:
ExitCode = Wsh.Run("cmd.exe /C " & DriveCommand & _RunCommand & _
"""" & WORKBOOK_FULLNAME & """ ""from_xl""" & " " & Chr(34) & _
Application.path & "\" & Application.Name & Chr(34) & " " & Chr(34) & Application.Hwnd & Chr(34) & _
" 2> """ & LOG_FILE & """ ", _
WindowStyle, WaitOnReturn)
方括号中的值-
"cmd.exe /C python -B -c "import sys, os; sys.path.extend(os.path.normcase(os.path.expandvars(r'path_to_folder;')).split(';')); import fibonacci; fibonacci.xl_fibonacci()" ""path_to_xlsm" "from_xl" "C:\Program Files\Microsoft Office\Root\Office16\Microsoft Excel" "3869396" 2> "C:\path\AppData\Roaming\xlwings.log" "
我对此问题有任何想法。谢谢!