全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1873 6
2017-02-14
用如下代码打开excel时,可能该文件正被另一程序使用,因此想用只读方式打开再另存,怎么写?
复制代码

QQ图片20170214164114.png
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2017-2-16 13:52:58
options noxwait noxsync;
x '/r "D:\产品统计.xlsx"';

Here using X places you in your operating environment(such as Windows), where you can issue commands specific to your operating environment(such as Windows).
The switch /r instructs Excel to open a specified file as read-only.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-17 11:42:13
misslost 发表于 2017-2-16 13:52
options noxwait noxsync;
x '/r "D:\产品统计.xlsx"';
谢谢回复!可是试了一下,无法实现和上面截图中一样的效果,运行这句后弹出下面这个窗口,然后瞬间消失: 捕获.JPG
您知道问题出在哪里吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-17 11:58:44
复制代码

运行这个代码打开excel,毫无反应。是sas权限的问题吗?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-17 12:53:09
I have no issue running the commands on my computer.

Maybe you should check your SAS components or configuration.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2017-2-17 13:06:51
Try this one.

x '"C:\Program Files (x86)\Microsoft Office\Office15\excel.exe" /r "D:\产品统计.xlsx"';

Here you need customize the file path of excel.exe on your computer.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群