Update links automatically when opening file

T

Tim Otero

This one's got me stumped. I'd like to be able to bypass the update
links dialog box when opening a file. I know I can do this by unclicking
"ask to update automatic links" in tools|options, but that will enable
that behavior for only me. I'd like the user to not need to click
"update links" every time they open the workbook, as they already need
to enable macros.

Thanks in advance,

tim
 
G

Geoff

Hi Tim

Put this in the ThisWorkBook module but be aware this setiing is an
application wide setting and for that reason when the wbook is closed the
setting should be restored to the users own preference.

hth

Geoff

Option Explicit

Dim bWbAskLinksOn As Boolean

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.AskToUpdateLinks = bWbAskLinksOn
End Sub

Private Sub Workbook_Open()
With Application
bWbAskLinksOn = .AskToUpdateLinks
.AskToUpdateLinks = False
End With
End Sub
 
T

Tim Otero

Geoff said:
Hi Tim

Put this in the ThisWorkBook module but be aware this setiing is an
application wide setting and for that reason when the wbook is closed the
setting should be restored to the users own preference.

hth

Geoff

Option Explicit

Dim bWbAskLinksOn As Boolean

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Application.AskToUpdateLinks = bWbAskLinksOn
End Sub

Private Sub Workbook_Open()
With Application
bWbAskLinksOn = .AskToUpdateLinks
.AskToUpdateLinks = False
End With
End Sub
Thank you Geoff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top