Splash screen not working in hidden workbook

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
 
G

GS

Try specifying...

frmErrorMsg.Show vbModeless

...so your code continues to run while it displays.

You could look at using OnTime() to unload it OR include that in
frmMainMenu's 'Initialize' event instead of using a separate routine
just to unload the splash screen.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
L

Ludo

Op vrijdag 25 mei 2012 01:00:24 UTC+2 schreef GS het volgende:
Try specifying...

frmErrorMsg.Show vbModeless

..so your code continues to run while it displays.

You could look at using OnTime() to unload it OR include that in
frmMainMenu's 'Initialize' event instead of using a separate routine
just to unload the splash screen.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

Thanks Garry,

Will look into that possibility.
I'm (at work) still on Office 2003 but will upgrade to Office 2010 within a few weeks from now.

I'm holding my breath to make the change to Excel 2010.

I tested only the needed code for the splash screen (in my initial) at home (Excel 2007 / Vista) and there did it work as expected when i set the IsAddin property to TRUE.

Regards,
ludo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top