L
Ludo
Hi,
i like to use a splash form in a HIDDEN WORKBOOK, but it seems to be
not working.
Problem is that the frmErrorMsg keeps open after the 5 sec. delay, so
there's no Unload event, because the "Close Form" routine isn't
called.
Is there a possibility to get this working in a HIDDEN WORKBOOK (Add-
In)?
Do i have to specify where the Close Form routine can be found?
If so how to do so.
I have following code, works as long as the workbook ISN'T hidden
(IsAddin = False):
Sub StartHere()
'import the common settings into sheet common settings
Dim FullPath As String
Dim Sep As String
Dim SheetName As String
Dim blfileExist As Boolean
Dim blPathExist As Boolean
blnDEBUG = True 'only needed for debugging
strUnitDataLog = strUnit_DataLog & txtFileExtension 'unit
data logging file name
FullPath = ThisWorkbook.path
'test if path exist - server online
'if not found, keep on retrying
blPathExist = FileOrDirExists(FullPath)
While blPathExist = False
strErrorMSG = "Directory " & vbCrLf & _
FullPath & vbCrLf & _
" niet gevonden!" & vbCrLf & vbCrLf & _
"Mogelijk is de server offline of niet verbonden."
frmErrorMsg.cmdOK.Caption = "Retry"
frmErrorMsg.cmdClose.Visible = False
frmErrorMsg.Show
'test again if path exist - server online
blPathExist = FileOrDirExists(FullPath)
Wend
'test if file commonsettings.txt exist, if not show frmCommonSettings
FullPath = ThisWorkbook.path & "\Common Settings" &
txtFileExtension
'test if file exists
'if not show Common Settings form
blPathExist = FileOrDirExists(FullPath)
If blnDEBUG = True Then blPathExist = False
If blPathExist = False Then
strErrorMSG = "Gemeenschappelijk configuratie bestand niet
gevonden. " & vbCrLf & vbCrLf & vbCrLf & "Een ogenblik geduld A.U.B."
& _
vbCrLf & vbCrLf & "Configuratie formulier start binnen 5 sec."
Application.OnTime Now + TimeValue("00:00:05"),
Procedure:="CloseForm", Schedule:=True
blnSplash = True
frmErrorMsg.Show
frmCommonSettings.Show
End If
'load common setting file if common settings file exist
'else bail out
If blnErrorTrapped = False Then
Sep = vbTab
SheetName = "Common Settings"
'load common settings
ImportTextFile FullPath, Sep, SheetName
End If
'show main form
frmMainMenu.Show
End Sub
Sub CloseForm()
Unload frmErrorMsg 'remove everything from this form from memory
and close form
End Sub
Any help welcome.
Thanks in advance
Ludo
i like to use a splash form in a HIDDEN WORKBOOK, but it seems to be
not working.
Problem is that the frmErrorMsg keeps open after the 5 sec. delay, so
there's no Unload event, because the "Close Form" routine isn't
called.
Is there a possibility to get this working in a HIDDEN WORKBOOK (Add-
In)?
Do i have to specify where the Close Form routine can be found?
If so how to do so.
I have following code, works as long as the workbook ISN'T hidden
(IsAddin = False):
Sub StartHere()
'import the common settings into sheet common settings
Dim FullPath As String
Dim Sep As String
Dim SheetName As String
Dim blfileExist As Boolean
Dim blPathExist As Boolean
blnDEBUG = True 'only needed for debugging
strUnitDataLog = strUnit_DataLog & txtFileExtension 'unit
data logging file name
FullPath = ThisWorkbook.path
'test if path exist - server online
'if not found, keep on retrying
blPathExist = FileOrDirExists(FullPath)
While blPathExist = False
strErrorMSG = "Directory " & vbCrLf & _
FullPath & vbCrLf & _
" niet gevonden!" & vbCrLf & vbCrLf & _
"Mogelijk is de server offline of niet verbonden."
frmErrorMsg.cmdOK.Caption = "Retry"
frmErrorMsg.cmdClose.Visible = False
frmErrorMsg.Show
'test again if path exist - server online
blPathExist = FileOrDirExists(FullPath)
Wend
'test if file commonsettings.txt exist, if not show frmCommonSettings
FullPath = ThisWorkbook.path & "\Common Settings" &
txtFileExtension
'test if file exists
'if not show Common Settings form
blPathExist = FileOrDirExists(FullPath)
If blnDEBUG = True Then blPathExist = False
If blPathExist = False Then
strErrorMSG = "Gemeenschappelijk configuratie bestand niet
gevonden. " & vbCrLf & vbCrLf & vbCrLf & "Een ogenblik geduld A.U.B."
& _
vbCrLf & vbCrLf & "Configuratie formulier start binnen 5 sec."
Application.OnTime Now + TimeValue("00:00:05"),
Procedure:="CloseForm", Schedule:=True
blnSplash = True
frmErrorMsg.Show
frmCommonSettings.Show
End If
'load common setting file if common settings file exist
'else bail out
If blnErrorTrapped = False Then
Sep = vbTab
SheetName = "Common Settings"
'load common settings
ImportTextFile FullPath, Sep, SheetName
End If
'show main form
frmMainMenu.Show
End Sub
Sub CloseForm()
Unload frmErrorMsg 'remove everything from this form from memory
and close form
End Sub
Any help welcome.
Thanks in advance
Ludo