+ Reply to Thread
Results 1 to 9 of 9

Application ScreenUpdating Not working

  1. #1
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    244

    Application ScreenUpdating Not working

    Hi,

    I have the below as the last portion of a larger macro:

    Please Login or Register  to view this content.
    There are a number of workbooks opened prior in the code and this snippet closes everything except ThisWorkbook. I've included Application.Screenupdating = False, but that doesn't seem to work. Does anyone have any idea why?

  2. #2
    Forum Moderator dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Application ScreenUpdating Not working

    Good evening bigjdawg43

    Is that not what is supposed to happen?
    The "For Each..." statement cycles through all workbooks open in Excel and asks "is this the currently active workbook?". If the answer is no, then that workbook is closed.
    Application.Screenupdating=False just restricts what you see.
    What should happen?

    HTH

    DominicB

  3. #3
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    244

    Re: Application ScreenUpdating Not working

    Sorry, I just reread my original post and it is not clear at all

    What I meant is that the Application.Screenupdating piece is not working, in that, I still get asked if I want to save each workbook even though Application.Screenupdating = False. I'm trying to bypass excel asking me if I want to save each workbook...

  4. #4
    Forum Moderator dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Application ScreenUpdating Not working

    Hi bigjdawg43

    In this instance Application.Screenupdating won't do anything except stop any screen flicker, which you probably won't get because you're not selecting anything.
    The command you're thinking of is Application.ShowAlerts=False - try using that.
    Or you could use xWB.Saved=True before your close statement. This tells Excel that the file has been saved already - even if it hasn't. If Excel "thinks" that the file has already been saved, it won't bother asking.

    HTH

    DominicB

  5. #5
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    244

    Re: Application ScreenUpdating Not working

    I get a run time error 438 ("Object doesn't support this property or method") when I try this. In the above loop, where would I try xWB.Saved = True?

  6. #6
    Forum Moderator dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Application ScreenUpdating Not working

    Hi bigjdawg43

    Your module should look like this :
    Please Login or Register  to view this content.
    HTH

    DominicB

  7. #7
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365 ProPlus
    Posts
    9,489

    Re: Application ScreenUpdating Not working

    You just need to replace the line xWB.Close with xWB.Close True if you want to save any changes made in the workbook being closed.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  8. #8
    Forum Contributor
    Join Date
    06-30-2017
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2013
    Posts
    244

    Re: Application ScreenUpdating Not working

    Thank you both very much!

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365 ProPlus
    Posts
    9,489

    Re: Application ScreenUpdating Not working

    You're welcome! Glad we could help.

+ 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. Application.ScreenUpdating not working
    By jimapos in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-16-2017, 11:09 AM
  2. [SOLVED] Application.screenupdating True towards False isnt working
    By Fean in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2016, 11:45 AM
  3. Application.Screenupdating = False - not working
    By demarc in forum Excel General
    Replies: 3
    Last Post: 05-02-2015, 11:02 AM
  4. Application.Screenupdating = false not working
    By tanvi_kalra in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 01-30-2014, 09:55 AM
  5. Application.ScreenUpdating not working with Application.Run
    By WaqasTariq in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-18-2012, 02:24 PM
  6. [SOLVED] Application.ScreenUpdating not working
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2012, 05:19 AM
  7. Application.screenupdating = False is not working
    By gnome_core in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2009, 03:32 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