Consulting

Results 1 to 7 of 7

Thread: Solved: How to retrieve a closed application

  1. #1
    VBAX Regular
    Joined
    Feb 2008
    Posts
    8
    Location

    Solved: How to retrieve a closed application

    I have put this code in a workbook that as soon as it opens it is hidden. How do I reverse this or retrieve the workbook to fix the problem. Kinda new at VBA and realized I messed up.

    Sub Open_Workbook()
    Application.Visible = False
    End Sub

    Mark$1

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Go into the VBIDE, Alt-F11

    In the Immediate window (Ctrl-G), type

    windows("the_workbook_name.xls").Visible=true
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You can prevent startup macros from running by holding down the shift key when you open the file.
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  4. #4
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    You can still access the workbooks code modules even though it is hidden. So when you open the VBE, expand the workbook, double click the ThisWorkbook module and edit the necessary code.

    HTH

  5. #5
    VBAX Regular
    Joined
    Feb 2008
    Posts
    8
    Location
    Thanks for the help. It is much appreciated. You cant imagine the panic I was in!

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by firefytr
    You can still access the workbooks code modules even though it is hidden. So when you open the VBE, expand the workbook, double click the ThisWorkbook module and edit the necessary code.

    HTH
    That name seems familiar ....
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Wha.. who... where.. ?? Oh, ahem, hi, my name is Zack. And I'm an Excel addict. Very pleased to meet you.

Posting Permissions

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