Display Alerts problem..

JST013

Board Regular
Joined
Mar 11, 2015
Messages
74
Hello all,

So I'm having a bit of trouble understanding Application.DisplayAlerts....

Why can it not stop this error from displaying...

excelalert.png


I have this in a workbook open event and every time it opens it shows this alert. I also run some code to update my links which is why the alert is even more confusing...The links update just fine as well.

The following is the relevant code...


Code:
'I also tried this 
'Application.AskToUpdateLinks = False

Application.ScreenUpdating = False
Application.DisplayAlerts = False

'the code here to update my links that I know works[INDENT=2]linkarray = Workbooks("Assembly.xlsm").LinkSources(xlExcelLinks)[/INDENT]
            x = linkarray(1)
            Workbooks("Workbook1.xlsm").OpenLinks x, True, xlExcelLinks
            Workbooks("Workbook2.xlsm").Close False
Application.ScreenUpdating = True
Application.DisplayAlerts = True

What am I doing wrong? :D Is it possible to not display that alert?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi,
Maybe it helps:
<code>
Rich (BB code):
Application.AskToUpdateLinks = false

'some code

<code>Application.AskToUpdateLinks = True
</code></code></pre>
 
Upvote 0
Try using this

Sub Links1A()
Application.AskToUpdateLinks = False

'What do you want to do here

Application.AskToUpdateLinks = True
End Sub
 
Upvote 0
Thank you for the reply, but that did not work either...Maybe I just have to live with it :(
 
Upvote 0
I got it to work...I'm not sure why this worked but....

Code:
Private Sub workbook_open()
    linka
    Application.ScreenUpdating = False
    coveractive
    Application.ScreenUpdating = True
End Sub

Private Sub linka()
    Application.DisplayAlerts = False
End Sub


Sub coveractive()
    Dim cover As Worksheet
    Set cover = ThisWorkbook.Sheets("Cover")
    cover.Activate
    Application.DisplayAlerts = True
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,402
Messages
6,119,304
Members
448,886
Latest member
GBCTeacher

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