I want to search through existing Excel files with a macro, but I don't want to display those files when they're opened by the code. Visible = False 'Visible is False by default, so this isn't necessary Dim book As Excel. Borrowing the connection string from a project I've used it on, it will look kinda like this: Note that "Registration List" is the name of the tab in the workbook. If you don't the user might not be able to open excel files by double clicking or launching from other apps unless they logoff or know how to kill processes (because the files get opened in the invisible window). Screen Updating = True End Sub Private Sub Workbook_Before Close(Cancel As Boolean) w. Saved = True 'this will suppress the safe prompt for the data file only End Sub This is somewhat derivative of the answer posted by Ashok.
My Excel tool performs a long task, and I'm trying to be kind to the user by providing a progress report in the status bar, or in some cell in the sheet, as shown below.
But the screen doesn't refresh, or stops refreshing at some point (e.g. The task eventually completes but the progress bar is useless. For i=1 to imax ' imax is usually 30 or so fraction Done=cdbl(i)/cdbl(imax) Application.
In some examples we turn off Calculation and Screenupdating.
The reason we turn off calculation is in case the range in which we are deleting rows contains lots of formulas, if it does Excel may need to recalculate each time a row is deleted, slowing down the macro.
It is important to note that the least efficient methods involve those that use loops.