简体   繁体   English

Solidworks PDM 启动 Excel 参数

[英]Solidworks PDM Launching Excel with Parameters

I have a Solidworks PDM transition that launches a particular Excel sheet that has a Workbook_Open routine that receives a parameter passed in from PDM.我有一个 Solidworks PDM 过渡,它启动一个特定的 Excel 工作表,该工作表有一个 Workbook_Open 例程,该例程接收从 PDM 传入的参数。 That parameter is the %folderpath% of the file being transitioned in PDM.该参数是在 PDM 中转换的文件的 %folderpath%。 The Excel routines run fine. Excel 例程运行良好。 However, Excel is trying to do too much with the passed in path.但是,Excel 试图对传入的路径做太多事情。 After the routine in Excel runs, an Excel dialog is throw as shown here: Excel 中的例程运行后,会抛出一个 Excel 对话框,如下所示: 错误信息

Excel is mashing the passed in path with an.xlsx extension (its running a.xlsm file). Excel 正在将传入的路径与 .xlsx 扩展名(其运行的 a.xlsm 文件)混合在一起。 Here is the command line being executed in PDM "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE""C:\Users\guy\Desktop\TEST FOLDER RENAME.xlsm" /e/ %FolderPath% where the full folder path is C:\PTI\ECO\General\CR-0023482.这是在 PDM 中执行的命令行 "C:\Program Files (x86)\Microsoft Office\Root\Office16\EXCEL.EXE""C:\Users\guy\Desktop\TEST FOLDER RENAME.xlsm" /e/ % FolderPath%,其中完整文件夹路径为 C:\PTI\ECO\General\CR-0023482。 Any ideas on why Excel is throwing this message and is there a way to suppress/stop it?关于为什么 Excel 会抛出此消息的任何想法,是否有办法抑制/阻止它?

I found the issue and it is subtle.我发现了这个问题,它很微妙。 The command line in PDM's transitions action cannot have a space between the called spreadsheet and the passed in parameter. PDM 转换操作中的命令行在调用的电子表格和传入的参数之间不能有空格。 This argument works.这个论点有效。 "C:\Temp\F-Rename.xlsm"/e/%FolderPath% vs. "C:\Temp\F-Rename.xlsm" /e/%FolderPath%. “C:\Temp\F-Rename.xlsm”/e/%FolderPath% 与“C:\Temp\F-Rename.xlsm”/e/%FolderPath%。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM