Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
VBA版本系统_Vba - Fatal编程技术网

VBA版本系统

VBA版本系统,vba,Vba,我有一个visual basic应用程序,主机中有一个名为version.txt的文件 我想将其连接到我的vba应用程序,每当我更改version.txt中写入的数字时,应用程序都会警告用户下载新版本的应用程序。我怎样才能做到这一点呢?。该常量将保留在应用程序中,并且Version.txt中的值将更改 Public Const dVERSION As Double = 6.2 Public Function IsCurrentVersion() As Boolean Dim sFil

我有一个visual basic应用程序,主机中有一个名为version.txt的文件


我想将其连接到我的vba应用程序,每当我更改version.txt中写入的数字时,应用程序都会警告用户下载新版本的应用程序。我怎样才能做到这一点呢?

。该常量将保留在应用程序中,并且Version.txt中的值将更改

Public Const dVERSION As Double = 6.2

Public Function IsCurrentVersion() As Boolean

    Dim sFile As String
    Dim lFile As Long
    Dim dVer As Double

    sFile = ThisWorkbook.Path & Application.PathSeparator & "Version.txt"
    lFile = FreeFile

    Open sFile For Input As lFile
    Input #lFile, dVer
    Close lFile

    IsCurrentVersion = dVer <= dVERSION

End Function
Public Const d版本为Double=6.2
公共函数IsCurrentVersion()为布尔值
将文件设置为字符串
像长一样暗的文件
双色数字录像机
sFile=ThisWorkbook.Path和Application.PathSeparator&“Version.txt”
lFile=FreeFile
打开sFile作为lFile输入
输入文件,dVer
封闭式文件

IsCurrentVersion=dVer哪个是您的“应用程序”?excel、word、其他?每次你认为重要的时候,你都可以记住最后一个版本并检查文件版本。你没有提供太多有助于提出其他建议的信息。。。