+ Reply to Thread
Results 1 to 8 of 8

Need to close VBE before save

  1. #1
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Need to close VBE before save

    My file saves correctly when the VBE is closed, however if the VBE is open the closing code functions and saves but the VBE screen will display an Out of Memory warning. When the OK is clicked on that warning Excel has stopped and then goes through a restart. The file has been saved correctly.
    In trying to use code to close the VBE.
    I've attempted
    Please Login or Register  to view this content.
    When put into a macro this just gives a ping sound, and nothing else appears to happen.
    How can I close the VBE using code?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Need to close VBE before save

    What happens if you try the below one.

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Need to close VBE before save

    Thanks but - Fails with message Programmatic access to Visual Basic Project is not trusted

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Need to close VBE before save

    Refer the below screenshot to know how to enable Trust Access setting in excel VBA.
    Attached Images Attached Images

  5. #5
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Need to close VBE before save

    Yes works as required - Thanks
    Presume I need to wrap an IF around it having recognised me so that other don't bomb out.
    I can do that if required, just a Yes or No
    Thanks in advance of that, and I'll do the Solved and rep things now.

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Need to close VBE before save

    I believe it won't throw any errors if the VBE is not in open or in hidden.

    Anyhow here is the If condition to check whether VBE is in open and if it is in open then it will hide the window.

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Need to close VBE before save

    Thanks again, a much better solution than mine which was just to recognise me.

  8. #8
    Registered User
    Join Date
    10-31-2012
    Location
    Victoria, Australia
    MS-Off Ver
    Excel 2010
    Posts
    79

    Re: Need to close VBE before save

    Needed to implement identify who was using so as to avoid the Application.VBE if some using. This for users who were unlikely to ever have VBE open and selecting the Trust Center setting was too scary.
    All good though.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Save the current worrkbook, save the sheet as .csv and close the workbook
    By SpeediWeb in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-10-2015, 06:50 AM
  2. Macro to Save current XLS, then to save as a CSV. Then close CSV and reopen XLS
    By cricker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-02-2014, 06:17 AM
  3. Save As but keep active wb open but the Save As .close
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2014, 01:45 PM
  4. Close ALL Workbooks and Save Changes WITHOUT asking do I want to save.
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-19-2013, 11:46 AM
  5. Replies: 1
    Last Post: 10-25-2013, 06:10 PM
  6. Code, that disables save, save as and close commands
    By mgmetev in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-02-2009, 06:31 PM
  7. To save and close
    By Steved in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM

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