-1

I am opening a file in VBA and want to ignore the above message after my file opens through the code. That is I don't want to update the file and want to continue running the code . How can I do it? I am opening multiple file and I need to wait for every file to display that, instead I thought I can do it through code.

filter = "Text files (*.xls*),*.xls*"
Caption = "Please Select the a file"
Ret = Application.GetOpenFilename(filter, , Caption)
If Ret = False Then Exit Sub
Set wb = Workbooks.Open(Ret)

Application.displayAlerts=False does not work for this. Is there anyway to manage it? Thanks.

Jain
  • 959
  • 2
  • 13
  • 31
  • https://stackoverflow.com/questions/27606970/how-to-open-excel-workbooks-without-the-message-the-workbook-contains-links-to-o?s=1|1.4140 – CactusCake Mar 27 '15 at 20:23
  • http://stackoverflow.com/questions/14908372/how-to-suppress-update-links-warning – Jain Mar 27 '15 at 20:23
  • @Joe Even after using "Application.AskToUpdateLinks = False" I am still getting message like This workbook has some links missing. "Continue or Edit" Any help on this please – Jain Mar 27 '15 at 20:36
  • Do you still have `Application.displayAlerts=False` in your code or did you take it out when you put in `Application.AskToUpdateLinks = False`? I would expect a combination of the two lines to get around the warning. (Don't forget to turn displayAlerts back on at the end of the macro). That said, Excel provides that warning for a reason - it might be worth checking through the offending workbook and fixing any broken links. – CactusCake Mar 27 '15 at 20:56

1 Answers1

0

Try This:

Private Sub Workbook_Activate()
   Application.AskToUpdateLinks = False

End Sub

source

Community
  • 1
  • 1
Pat D
  • 26
  • 1
  • 4
  • Even after using "Application.AskToUpdateLinks = False" I am still getting message like This workbook has some links missing. "Continue or Edit" Any help on this please – Jain Mar 27 '15 at 20:38
  • Did Joe's answer to your question solve the problem? – Pat D Mar 30 '15 at 21:53