zhuwy16 发表于 2006-11-23 16:30:00

APP

VBA为什么不支持APP阿
我写的代码:
APP.Path & "data.txt"总是报错阿??

iq0050 发表于 2006-11-24 09:50:00

试了一下,是不支持APP.不过用API函数能够得到当前的目录.我做了一个小的得到当前目录的VBA函数试了一下可能得到.
Option Explicit
Private Declare Function GetCurrentDirectoryA Lib "kernel32" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long
Sub GetAppPath()
Dim strPath As String
Dim PathLength As Long
strPath = Space$(1024)
PathLength = GetCurrentDirectoryA(Len(strPath), strPath)
End Sub
strPath中得到的就是当前目录,就是当前dvb文件所保存的目录.

zhuwy16 发表于 2006-11-25 21:12:00

谢谢
页: [1]
查看完整版本: APP