+ Reply to Thread
Results 1 to 5 of 5

Hide application

  1. #1
    Forum Contributor spinkung's Avatar
    Join Date
    10-27-2006
    Posts
    199

    Hide application

    Hi all,

    I'm using a button on a form to save stuff to another workbook.
    I'm using.....
    Please Login or Register  to view this content.
    ...to open the workbook to be written to.

    I want it to be hidden though. (i know i've asked something similar before).

    Is there some way i can open a new instance if Excel when i open the workbook so i can hide that 'application.instance' instead of hiding the instance i'm working with?

    Merry XMas,
    Spinkung.

  2. #2
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Seems like your 2 options would be:
    1. what you suggest, opening a new Excel application and making that instance invisible

    2. opening the workbook in the current instance of Excel and making that workbook invisible

    Both are possible. I think #2 might be a lot faster. Creating a new Excel instance will take several seconds longer than simply opening a workbook. On the other hand, you cannot make the second workbook hidden until after you have opened it; so, even though you can freeze the screen (so the user does not see the workbook opening), an observant user would still see the taskbar icon for the second workbook.

    Here is the code for #1:
    Set xlApp = CreateObject("Excel.Application")
    xlApp.Visible = False
    'put your code here
    xlApp.Quit
    Set xlApp = Nothing

    Remember that if you take approach #1, you need to use very specific object references.

  3. #3
    Forum Contributor spinkung's Avatar
    Join Date
    10-27-2006
    Posts
    199
    Excellent, Thanks MSP.

    Can you point me inthe direction of how to hide a workbook as i can seem to find out how to do it anywhere???

    cheers,
    spinkung

  4. #4
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Here is an example. Well, 2 examples actually

    Please Login or Register  to view this content.
    Probably when you first open the workbook, it only has one Window. So, the one line of code would be enough. But, no harm in using the 3 lines of code.

    To integrate that into your code ...

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor spinkung's Avatar
    Join Date
    10-27-2006
    Posts
    199
    Hi,

    I have been away training for the last few days so i've only just had a chance to check this reply out and it works a treat so i'd just like to say thanks for your help MSP.


    Cheers,
    Spinkung

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1