|
-
Dec 7th, 2005, 04:21 AM
#1
Thread Starter
Lively Member
Making Excel invisible!!
Hi guys, with your help I've created a nice form in XL using VB code. I'm looking at giving it that professional look so I can distribute it around the company I work for. I would like it to look like a stand alone program if this is possible. At the moment I'm using the following code in the excel workbook:
Code:
Private Sub Workbook_Open()
Application.Visible = False
frmSplash.Show
End Sub
The problem with this is the application opens and shows for a brief second before hiding which doesn't look to good. Is there anyway to improve on this?
Thanks
Last edited by thelocaluk; Dec 12th, 2005 at 10:36 AM.
-
Dec 7th, 2005, 08:17 AM
#2
Re: Making application invisible!!
Moved to Office Development.
-
Dec 8th, 2005, 08:47 AM
#3
New Member
Re: Making application invisible!!
Just watch that type of thing. If a user closes any Dialog box with the 'X' button by mistake, the application will still be running in the background. The only way of closing it down is using the task manager.
Don't know the code, but you could try minimising it .
-
Dec 8th, 2005, 12:17 PM
#4
Lively Member
Re: Making application invisible!!
 Originally Posted by ModusOperandi
Just watch that type of thing. If a user closes any Dialog box with the 'X' button by mistake, the application will still be running in the background. The only way of closing it down is using the task manager.
Don't know the code, but you could try minimising it .
Try this:
Code:
Private Sub UserForm_Terminate()
Application.Visible = True
ThisWorkbook.Saved = True
Application.Quit
End Sub
Not sure how to eliminate the "Flicker" you see when Excel first opens... I have the same issue.
Matt
-
Dec 12th, 2005, 08:48 AM
#5
Thread Starter
Lively Member
Re: Making application invisible!!
I use this code to prevent users from closing the forms with the x button.
Code:
Private Sub userform_QueryClose(Cancel As Integer, _
CloseMode As Integer)
If CloseMode = vbFormControlMenu Then
Cancel = True
MsgBox "Please use the Exit button!"
End If
End Sub
This forces the user to close the form using the appropriate button to save and safely close the application.
Still no luck solving the startup flicker but if i ever figure a way around it I'll let you know Matt.
Last edited by thelocaluk; Dec 12th, 2005 at 08:52 AM.
-
Dec 12th, 2005, 11:10 AM
#6
Thread Starter
Lively Member
Re: Making Excel invisible!!
Heres a solution for future reference. It is not possible directly, however you can use automation. In that case an instance of excel starts hidden. The most straightforward is scripting. Just create a text file with:
Code:
Dim objXL
Set objXL = WScript.CreateObject("Excel.Application")
objXL.WorkBooks.Open "FullPath\FileName.xls"
and change file extension to ‘vbs’. Excel starts after double-clicking the script file, the drawback of this method is hardcoded excel file path.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|