作者:乔山办公网日期:
返回目录:excel表格制作
aa = Word.Application.Documents.Open ("d:\托福入度班测试问反馈答.docx",readonly=false)
if aa.readonly = true then
msgbox("只读方式回答")
else
msgbox("非只读方式")
end if
重启机器试试看,可能文件被别的进程打开了,所以只能只读方式打开。
是 microsoft open xml converter 转换软件捣乱。 让正常的打开方式来 excel2007 无法介入,只有microsoft open xml converter,没法选择别的打开方式。源
解决方法: 打开任意一个 excel2003 文件 ,然后百用软件内的 文件 打开 选择要打开的文件,度然后关闭,出来后 选择要打开的文件 右键 打开方式 打开默认选择 excel2007 勾选上始终使用此程序打开。
就此大功告成。以后就不会出现此问题了。
Sub a()
Dim mypath As String
Dim myfile As String
mypath = "d:\123\"
myfile = "a.xls"
Workbooks.Open mypath & myfile, , True
End Sub
在OPEN中的第三知个参数。=TRUE表示,道为只读版方式打开。
测试权OK!