Solved

How do I ensure my Excel VBA application doesn't display each sheet as it processes them ?

Posted on 2014-11-12
3
76 Views
Last Modified: 2014-11-12
Hi All,

My Excel application reads rows from one workbook and copies them to another. In fact, it processes each sheet in turn and depending on certain conditions selectively copies/pastes the rows to corresponding sheets.

The procedure opens an input workbook and an output workbook and amongst all this activity, the application switches from one sheet to another, opening a file and displaying the sheet that is currently active.

How do I stop this ? I want the procedure to run from the Menu sheet (click of a button) and all processing to be done in the background with the Menu sheet continually displayed until the end of the procedure.

I tried inserting Activate statements throughout the procedure but it got into a mess.

Is there a standard command which I can employ for this functionality.

Thanks
Toco
0
Comment
Question by:Tocogroup
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
gowflow earned 500 total points
ID: 40437420
Put this in the start of the procedure:

'---> Disable Events
With Application
    .EnableEvents = False
    .ScreenUpdating = False
    .DisplayAlerts = False
End With

Open in new window



and just before the end of the sub put this
'---> Enable Events
With Application
    .EnableEvents = True
    .ScreenUpdating = True
    .DisplayAlerts = True
End With

Open in new window


This will ensure no fliquering and that you macro will execute the procedure and will not go to other events before it finishes

gowflow
0
 

Author Closing Comment

by:Tocogroup
ID: 40437554
Ah yes now I remember ! Thanks for that. Works perfectly
0
 
LVL 29

Expert Comment

by:gowflow
ID: 40437563
Great !
gowflow
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now