Suppressing Download Dialog When Opening External Workbook

breynolds0431

Active Member
Joined
Feb 15, 2013
Messages
303
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello. I have a Workbook_Open() event that will open an external workbook and copy the values out and into a hidden sheet of ThisWorkbook. There's no issue with that functionality of the code. When the external file is opened, however, a download dialog displays showing the path of the external file, which is not ideal as that path should not be revealed. Sometimes it shows and sometimes it does not, which I'm assuming is based on the network speed at the time the file is being opened. I've tried wrapping the GetObject portion with Application.DisplayAlerts = False, which did not work. I've also tried changing the open method to a Workbooks.open(), but that also does not work.

Is there any way to suppress that download dialog or at least hide the path from being visible?

VBA Code:
Dim fPath As String: fPath = "\\network.networkpath.com\folder\subfolder\main\Unit Folder\Tracker\"
Dim folder As String: folder = Dir(fPath, vbDirectory)

If folder = vbNullString Then
Else

          Dim extSh As Worksheet
          
          Application.DisplayAlerts = False
          Set extSh = GetObject(fPath & "Tracker - Testing .xlsm").Worksheets("Webcast Schedules")
          Application.DisplayAlerts = True
          
          Dim thisWB As Workbook: Set thisWB = ThisWorkbook
          
          extSh.Parent.Application.EnableEvents = False
          
          With extSh
                    .Columns("A:A").Copy thisWB.Sheets("Lists").Columns("B:B")
          End With
          
          extSh.Parent.Close savechanges:=False
          
          With Application
                    .ScreenUpdating = True
                    .EnableEvents = True
          End With
End If
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,214,943
Messages
6,122,369
Members
449,080
Latest member
Armadillos

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