APP
<P>VBA为什么不支持APP阿</P><P>我写的代码:</P>
<P>APP.Path & "data.txt"总是报错阿??</P> <P>试了一下,是不支持APP.不过用API函数能够得到当前的目录.我做了一个小的得到当前目录的VBA函数试了一下可能得到.</P>
<P>Option Explicit<BR>Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long<BR>Sub GetAppPath()<BR> Dim strPath As String<BR> Dim PathLength As Long<BR> strPath = Space$(1024)<BR> PathLength = GetCurrentDirectoryA(Len(strPath), strPath)<BR>End Sub<BR>strPath中得到的就是当前目录,就是当前dvb文件所保存的目录.</P> <P>谢谢</P>
页:
[1]