ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automatically use or update links between two sheets using VBA? (https://www.excelbanter.com/excel-programming/383573-automatically-use-update-links-between-two-sheets-using-vba.html)

Karti

Automatically use or update links between two sheets using VBA?
 
I have two worksheets on different servers and because they have links
you are asked to update the links before you continue.

Is there a way to use VBA to automatically update this link without
the message window opening up?

I need to remove the message window because it confuses my users!

Any and all help is appreciated!

Regards

Karti
;)


[email protected]

Automatically use or update links between two sheets using VBA?
 
On Feb 20, 9:42 am, "Karti" wrote:
I have two worksheets on different servers and because they have links
you are asked to update the links before you continue.

Is there a way to use VBA to automatically update this link without
the message window opening up?

I need to remove the message window because it confuses my users!

Any and all help is appreciated!

Regards

Karti
;)


create an OpenWorkbook() macro that sets UpdateLinks:=1 when the
workbooks open...

-thatdude


Karti

Automatically use or update links between two sheets using VBA?
 
Many thanks for the reply.

I now have within VBA

Sub OpenWorkbook()

Application.DisplayAlerts = False
UpdateLinks = 1

End Sub

I still receive the alerts.....any ideas?

Cheers

Karti
;)




On 20 Feb, 16:34, wrote:
On Feb 20, 9:42 am, "Karti" wrote:

I have two worksheets on different servers and because they have links
you are asked to update the links before you continue.


Is there a way to use VBA to automatically update this link without
the message window opening up?


I need to remove the message window because it confuses my users!


Any and all help is appreciated!


Regards


Karti
;)


create an OpenWorkbook() macro that sets UpdateLinks:=1 when the
workbooks open...

-thatdude




Karti

Automatically use or update links between two sheets using VBA?
 

Actually after playing around I have the following - .

I now have within VBA

Sub OpenWorkbook()

Workbooks.Open Filename:="E:\Excel Test\testOne.xls", UpdateLinks:=3
Application.DisplayAlerts = False


End Sub

Now this works fine when I do it from an open book. But I would like
it to happen when the actual file opens .....any ideas?

Cheers

Karti
;)



Alan[_2_]

Automatically use or update links between two sheets using VBA?
 
Karti,

I would alter that slightly. You are turning DisplayAlerts off and never
turning them back on. This can cause undesired effects. You should never end
your code and leave display alerts off. If the user makes a change and
decides to close the workbook, it will close immediately without asking if
they want to save changes. I also altered the first line also. This allows
the code to run when the workbook opens. The way you had it, it was a simple
macro that could only be run while the workbook was open.

Sub Workbook_Open()
Application.DisplayAlerts = False
Workbooks.Open Filename:="E:\Excel Test\testOne.xls", UpdateLinks:=3
Application.DisplayAlerts = True
End Sub

Regards,

Alan


"Karti" wrote in message
oups.com...

Actually after playing around I have the following - .

I now have within VBA

Sub OpenWorkbook()

Workbooks.Open Filename:="E:\Excel Test\testOne.xls", UpdateLinks:=3
Application.DisplayAlerts = False


End Sub

Now this works fine when I do it from an open book. But I would like
it to happen when the actual file opens .....any ideas?

Cheers

Karti
;)






All times are GMT +1. The time now is 09:42 PM.

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