Hide everything other than the userform while macro is running

cowelka1

New Member
Joined
May 19, 2012
Messages
11
So I have created a macro to import data from another file when a document is opened. In an attempt to occupy the user I have created a user form to display while this runs and hidden the Excel file itself whilst this is the case.

The only problem I now have, is that when the source file is being opened to copy the data across, I get a windows prompt box telling me the status of that file being opened. Is there a way to hide this and show only the user form?

I'm sure this is going to be a simple line of additional code, but I can't find anything on any of the previous threads

What I have so far is as follows:

Code:
Application.Visible = False
UserForm1.Show vbModeless
Application.ScreenUpdating = False

Macro to open, import and close source file

Unload UserForm1
Application.Visible = True
Application.ScreenUpdating = True
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi,

Does this work:

Code:
Sub test()


    Application.Visible = False
    UserForm1.Show vbModeless
    Application.ScreenUpdating = False


[COLOR=#ff0000]    Application.DisplayAlerts = False[/COLOR]


    Macro to open, import and close source file


[COLOR=#ff0000]    Application.DisplayAlerts = True[/COLOR]


    Unload UserForm1
    Application.Visible = True
    Application.ScreenUpdating = True
    
    
End Sub

igold
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top