Application.DisplayAlerts problem

craigexcel

Active Member
Joined
Jun 28, 2006
Messages
286
Office Version
  1. 2016
Platform
  1. Windows
Previously the setting of "Application.DisplayAlerts = False" was working fine when my code used a specific reference to open the target workbook:

Workbooks.Open Filename:= _
"Z:\Finance\Monthend Files\2007 Actual\2007 Flash\" & FLASH_workbook & ".xls" _
, UpdateLinks:=0

However, I changed the code to open the target workbook, by opening a dialog box to allow the user to select the specific workbook from the available files:

Target_FLASH_Path_and_File_name = Application.GetOpenFilename("Excel-files,*.xls", , "Please select the file to open")
Workbooks.Open (Target_FLASH_Path_and_File_name)

Now the prompt to 'update links' (to external sources) appears each time I open the target workbook. Is there a way to modify the code to open the target workbook so the 'update' dialog box is bypassed as it was originally?
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

xenou

MrExcel MVP
Joined
Mar 2, 2007
Messages
16,836
Office Version
  1. 2019
Platform
  1. Windows
Hi:
Code:
Sub test()
Dim Target_FLASH_Path_and_File_name As String
Target_FLASH_Path_and_File_name = "Book1.xls"

Workbooks.Open Filename:=Target_FLASH_Path_and_File_name, UpdateLinks:=0
End Sub

Don't you just need to add the update links option to your open method in the new routine? Regards.
 

craigexcel

Active Member
Joined
Jun 28, 2006
Messages
286
Office Version
  1. 2016
Platform
  1. Windows
Alexander,
Thanks for your reply. That worked perfectly! I simply overlooked that detail.
 

Forum statistics

Threads
1,181,658
Messages
5,931,269
Members
436,785
Latest member
KingGideon

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
Top