ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update links automatically when opening file (https://www.excelbanter.com/excel-programming/413496-update-links-automatically-when-opening-file.html)

Tim Otero

Update links automatically when opening file
 
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

Geoff

Update links automatically when opening file
 
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

"Tim Otero" wrote:

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


Tim Otero

Update links automatically when opening file
 
Geoff wrote:
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

"Tim Otero" wrote:

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

Thank you Geoff


All times are GMT +1. The time now is 11:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com