Results 1 to 6 of 6

Thread: Making Excel invisible!!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    Question 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.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Making application invisible!!

    Moved to Office Development.

  3. #3
    New Member
    Join Date
    Dec 2005
    Posts
    4

    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 .

  4. #4
    Lively Member
    Join Date
    Jun 2005
    Posts
    81

    Re: Making application invisible!!

    Quote 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

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Nov 2005
    Location
    Oxford UK
    Posts
    76

    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
  •  



Click Here to Expand Forum to Full Width