该程序没有窗体!

解决方案 »

  1.   

    Public Sub CheckExist(fm As Form)           '检测是否重复运行了本软件    Dim title As String
        
        If App.PrevInstance Then
            title = App.title
            
            Call MsgBox("这程序正在运行,不能重复运行!", vbCritical)
            
            App.title = "" '如此才不会Avtivate到自己
            
            fm.Caption = ""
            AppActivate title 'activate先前就已行的程式
            End
        End If
    End Sub
    在程序中调用 CheckExist(Me)