我正在使用jenkins运行位于位置的.bat文件
C:UsersfooDesktopxxx.bat
内部
- 从另一台机器复制excel
- 调用在D:
D:fooNewtask.vbs
打开一个文件:
C:UsersfooDesktopxxxxxxxxxNew.xlsm
我得到的错误是
对于第一个excel:
The system cannot find the path specified
对于第二个New.xlsm:
D:fooNewtask.vbs(14, 1) Microsoft Excel: Microsoft Excel cannot access the file 'C:UsersfooDesktopxxxxxxxxxNew.xlsm'. There are several possible reasons:
The file name or path does not exist.
The file is being used by another program.
The workbook you are trying to save has the same name as a currently open workbook
我觉得奇怪的是,jenkins可以访问并运行foo用户目录中的.bat,而它却找不到C:UsersfooDesktopxxxxxxxxxNew.xlsm
-->我检查过它是否存在。
当手动运行.bat时,我没有问题。
有什么想法吗?
我遇到了同样的问题。此页面的解决方案有效https://techcommunity.microsoft.com/t5/sql-server-support-blog/error-8216-microsoft-office-excel-cannot-access-the-file-8217/ba-p/317477
x64:创建以下目录:C: \Windows\SysWOW64\config\systemprofile\DDesktop
x86:创建以下目录:C: \Windows\System32\config\systemprofile\Desktop。。。