楼主: 踩云飞
1934 6

用x语句打开excel时能否用【只读】方式 [推广有奖]

  • 0关注
  • 0粉丝

博士生

98%

还不是VIP/贵宾

-

威望
0
论坛币
53 个
通用积分
1.0000
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
35189 点
帖子
85
精华
0
在线时间
635 小时
注册时间
2010-3-8
最后登录
2021-9-22

楼主
踩云飞 发表于 2017-2-14 10:32:45 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
用如下代码打开excel时,可能该文件正被另一程序使用,因此想用只读方式打开再另存,怎么写?
  1. /*打开模板*/
  2. options noxwait noxsync;
  3. x '"D:\产品统计.xlsx"';   
复制代码

QQ图片20170214164114.png
二维码

扫码加我 拉你入群

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

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

关键词:EXCEL xcel exce cel DOS excel 程序

沙发
misslost 发表于 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
  1. options noxwait noxsync;
  2. x 'excel.exe';
复制代码

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

报纸
misslost 发表于 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.

地板
misslost 发表于 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.
已有 1 人评分论坛币 学术水平 热心指数 收起 理由
踩云飞 + 5 + 2 + 2 精彩帖子

总评分: 论坛币 + 5  学术水平 + 2  热心指数 + 2   查看全部评分

7
踩云飞 发表于 2017-2-17 13:54:37
misslost 发表于 2017-2-17 13:06
Try this one.

x '"C:\Program Files (x86)\Microsoft Office\Office15\excel.exe" /r "D:\产品统计.xls ...
这次成功了!十分感谢!!!完美解决了我的问题!!!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-24 11:58