添加vba模块失败

使用问题 · 635 次浏览
yfyq 创建于 2022-09-08 18:52

您好,请问这个如何解决呀


ttChen 2022-09-08 20:44 :

按照教程,开通VBA权限

yfyq 回复 ttChen 2022-09-09 16:33 :
您好,我按照您的教程第4部分手动开通了Word VBA权限,但是还是这样的情况
回复内容
ttChen 2022-12-08 09:56
#1

应该解决了,更新一下试试。

HENVE 2022-11-29 09:26
#2

相同的问题;vba权限已开,每次重启电脑就能用,一段时间之后又会跳这个解析表达式错误

 

Win-10.0.18363.0 Quicker-1.36.4.0 动作ID:e60dd472-ad59-46f5-9f4c-dcc7dcb93117 来源动作:f77bee44-ff37-4879-3bdf-08d95984e346 v4
Log文件路径:E:\TEMP\quicker_一键看文献_092449-898_log.htm 定位文件 复制文件 上传并复制网址
开始执行动作:一键看文献 2022-11-29 09:24:49
3动作初始化
 
50运行子程序“运行VBA”
[in]失败后停止【值/表达式】False
[in]子程序【值/表达式】运行VBA
[in]跳过调试输出【值/表达式】True
[in]类型【值/表达式】Word
[in]文件路径【值/表达式】
[in]VBA代码【值/表达式】Sub getCode()\r\n Dim code As String\r\n Dim r as Range\r\n code = ""\r\n For I = 1 To ActiveDocument.Fields.Count\r\n \tset r=ActiveDocument.Fields(I).result \r\n \tmylen = Len(ActiveDocument.Fields(I).code)\r\n \t\r\n If Selection.Range.Start >= r.Start-mylen-2 And Selection.Range.Start <= r.End + 1 And Left(ActiveDocument.Fields(I).code, 18) = " ADDIN ZOTERO_ITEM" Then\r\n code = ActiveDocument.Fields(I).code \r\n Exit For\r\n End If\r\n Next\r\n Clipboard_SetText code\r\n End Sub\r\n \r\n \r\n Public Sub Clipboard_SetText(sInput As String)\r\n On Error GoTo Error_Handler\r\n With CreateObject("new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")\r\n .SetText sInput\r\n .PutInClipboard\r\n End With\r\n Error_Handler_Exit:\r\n On Error Resume Next\r\n Exit Sub\r\n Error_Handler:\r\n MsgBox "The following error has occurred" & vbCrLf & vbCrLf & _\r\n "Error Number: " & Err.Number & vbCrLf & _\r\n "Error Source: Clipboard_SetText" & vbCrLf & _\r\n "Error Description: " & Err.Description & _\r\n Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _\r\n , vbOKOnly + vbCritical, "An Error has Occurred!"\r\n Resume Error_Handler_Exit\r\n End Sub
耗时:1648ms
16531如果判断条件:$= String.IsNullOrWhiteSpace({[cliptext]})
[in]如果【值/表达式】False
不符合条件,跳过。
16582提取JSON内容$={[cliptext]}.Replace("ADDIN ZOTERO_ITEM CSL_CITATION ","") => {uri} {plainCitation} -...
已禁用,跳过
16593赋值$={ JObject json = JObject.Parse({[cliptext]}.Replace(... => {authorList}
[in]失败后停止【值/表达式】True
使用Z.Expressions解析表达式出错,尝试使用DynamicExpresso.
异常:解析表达式出错。 内部错误:Unexpected character encountered while parsing value: �. Path '', line 0, position 0. 原始表达式:{ JObject json = JObject.Parse({[cliptext]}.Replace("ADDIN ZOTERO_ITEM CSL_CITATION ","")); var itemdata=json["citationItems"].Select( x=>new { uri=(string)x["uris"][0], author=(string.IsNullOrEmpty((string)x["itemData"]["author"][0]["family"])?((string)x["itemData"]["author"][0]["literal"]):((string)x["itemData"]["author"][0]["family"])) + " et al., "+ (string)x["itemData"]["issued"]["date-parts"][0][0] }).ToList(); itemdata.Select( x=>x.author + "|" + "zotero://select/library/items/" + Path.GetFileName(x.uri) ).ToList().JoinToString(); }
在 Quicker.Domain.Actions.X.XActionHelper.GetValueFromExpression2(String expression, ActionExecuteContext context) 在 Quicker.Domain.Actions.X.XActionHelper.rot0S7dt0vD(<>c__DisplayClass2_0& ) 在 Quicker.Domain.Actions.X.XActionHelper.GetParamValue(StepInParamDef paramDef, ActionStep step, ActionExecuteContext context, Boolean skipLogging, Boolean skipConvert, Boolean skipLogContent) 在 Quicker.Domain.Actions.X.BuiltinRunners.Misc.AssignValueStep.<>c__DisplayClass37_0.M3xotR8M7iA() 在 Quicker.Domain.Actions.X.XActionHelper.ExecuteCommonAction(ActionExecuteContext context, ActionStep step, XAction action, Func`1 actionFunc, Action successAction, Action failAction, StepInParamDef stopIfErrorParam, StepOutParamDef isSuccessOutputParam)
步骤(sys:assign)执行失败,原因:解析表达式出错。 内部错误:Unexpected character encountered while parsing value: �. Path '', line 0, position 0. 原始表达式:{ JObject json = JObject.Parse({[cliptext]}.Replace("ADDIN ZOTERO_ITEM CSL_CITATION ","")); var itemdata=json["citationItems"].Select( x=>new { uri=(string)x["uris"][0], author=(string.IsNullOrEmpty((string)x["itemData"]["author"][0]["family"])?((string)x["itemData"]["author"][0]["literal"]):((string)x["itemData"]["author"][0]["family"])) + " et al., "+ (string)x["itemData"]["issued"]["date-parts"][0][0] }).ToList(); itemdata.Select( x=>x.author + "|" + "zotero://select/library/items/" + Path.GetFileName(x.uri) ).ToList().JoinToString(); }
停止动作:解析表达式出错。 内部错误:Unexpected character encountered while parsing value: �. Path '', line 0, position 0. 原始表达式:{ JObject json = JObject.Parse({[cliptext]}.Replace("ADDIN ZOTERO_ITEM CSL_CITATION ","")); var itemdata=json["citationItems"].Select( x=>new { uri=(string)x["uris"][0], author=(string.IsNullOrEmpty((string)x["itemData"]["author"][0]["family"])?((string)x["itemData"]["author"][0]["literal"]):((string)x["itemData"]["author"][0]["family"])) + " et al., "+ (string)x["itemData"]["issued"]["date-parts"][0][0] }).ToList(); itemdata.Select( x=>x.author + "|" + "zotero://select/library/items/" + Path.GetFileName(x.uri) ).ToList().JoinToString(); }
耗时:11ms
检测到了中止标志(OperationFailed),停止后续步骤执行。
动作结束
回复主贴