请问我这个是怎么错了? Dim FSO As New FileSystemObject Dim txtfile As TextStream Dim a Dim begintimePrivate Sub Command1_Click() '建立一个文件,并向其中写入内容 begintime = Now Set a = App If FSO.FileExists(a.Path & "\temp.txt") Then Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending) Else Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending, True) End If txtfile.WriteLine begintime txtfile.WriteLine ("Date for design!") txtfile.WriteLine "***********" txtfile.Close End SubPrivate Sub Command2_Click() '打开原有的文件 Dim X Set a = App X = Shell("notepad.exe" + a + " \temp.txt", vbNormalFocus) End Sub为什么会有错误呢?错误提示如下:实时错误'438' 对象不支持该属性或方法
这样写: X = Shell("notepad.exe " & "app.path" & "\temp.txt", vbNormalFocus)
x = Shell("notepad.exe c:\temp.txt", vbNormalFocus)
End Sub
你是高手,能不能给留个联系方式,以后让我好向你讨教呢?
我给你留一个邮箱:[email protected]
可以和你交个朋友吗?
Dim FSO As New FileSystemObject
Dim txtfile As TextStream
Dim a
Dim begintimePrivate Sub Command1_Click() '建立一个文件,并向其中写入内容
begintime = Now
Set a = App
If FSO.FileExists(a.Path & "\temp.txt") Then
Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending)
Else
Set txtfile = FSO.OpenTextFile(a.Path & "\temp.txt", ForAppending, True)
End If
txtfile.WriteLine begintime
txtfile.WriteLine ("Date for design!")
txtfile.WriteLine "***********"
txtfile.Close
End SubPrivate Sub Command2_Click() '打开原有的文件
Dim X
Set a = App
X = Shell("notepad.exe" + a + " \temp.txt", vbNormalFocus)
End Sub为什么会有错误呢?错误提示如下:实时错误'438'
对象不支持该属性或方法
X = Shell("notepad.exe " & "app.path" & "\temp.txt", vbNormalFocus)
还是打不开原来已经存在的文件,我按照huxiangming(老虎)的方法改了,可还是打不开,给出提示:
系统找不到指定的路径!求你们了!再想想办法,帮帮我!
X = Shell("notepad.exe " & App.Path & "\temp.txt", vbNormalFocus)
我实验过了,肯定没有问题。
系统找不到指定的路径!
对呀,是我在temp.txt前多写了一个空格!
:)