This workbook contains links to other data sources

H

Hall

My workbook has links to other shared workbooks in the network. Whenever
the file is opened, the user gets the message "This workbook contains links
to other data sources".

Is there a way to skip this prompt?
 
H

Hall

OK, that's good for the individual user.

Can this be done for the file itself so that anyone opening the file
wouldn't get this prompt?
 
D

Dave Peterson

Saved from a similar question:

You can toggle the setting (user by user, though) via:

Tools|Options|Edit Tab.
There's a checkmark for "ask to update automatic links"

But this means that you suppress the question--the links still get updated.

This setting is for the individual user--and affects all their workbooks.

If you want more control:
Try creating a dummy workbook whose only purpose is to open the original
workbook with links updated:

Kind of like:

Option Explicit
Sub auto_open()
Workbooks.Open Filename:="c:\my documents\excel\book2.xls", UpdateLinks:=1
ThisWorkbook.Close savechanges:=False
End Sub

Then you open the dummy workbook and the links will be refreshed.
(read about that UpdateLinks argument in VBA's help.)
 
A

azidrane

Hey mate. I gave this a try.

Private Sub Workbook_Open()
Workbooks.Open Filename:="filename.xls", UpdateLinks:=1
ThisWorkbook.Close savechanges:=False
End Sub

And it works great. I have a question though. Is there a way to open
two workbooks, and then arrange them in a certian way? such as tiled
verticly or something?
 
D

Dave Peterson

You can record a macro when you arrange the windows (window|arrange) and you'll
see how to do it in code.

Option Explicit

Private Sub Workbook_Open()
Workbooks.Open Filename:="book1.xls", UpdateLinks:=1
Workbooks.Open Filename:="book2.xls", UpdateLinks:=1
ThisWorkbook.Windows(1).Visible = False 'hide that window
Windows.Arrange ArrangeStyle:=xlHorizontal
ThisWorkbook.Close savechanges:=False
End Sub
 

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