?
Solved

Update Links

Posted on 2014-08-13
8
Medium Priority
?
100 Views
Last Modified: 2014-08-18
Hi,

Im trying to update my links on workbook opening

so in the thisworkbook object, on open, i have the below sub, i am getting the error message

"Application defined or object defined" error

What is the error?

Thanks

Private Sub Workbook_Open()
Dim AWB As String

AWB = ActiveWorkbook.FullName

ActiveWorkbook.UpdateLink Name:=AWB, Type:=xlExcelLinks
End Sub

Open in new window

0
Comment
Question by:Seamus2626
  • 4
  • 3
8 Comments
 
LVL 34

Accepted Solution

by:
Rob Henson earned 1000 total points
ID: 40257951
Why have a sub to do that?

In Excel Options > Advanced - towards the bottom of the pane there is an option for "Ask to Update Automatic links". If you uncheck that option, you won't be asked about updating and it will just do it.

Thanks
Rob H
0
 
LVL 54

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 1000 total points
ID: 40257955
Hi,

pls try

ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources

Regards
0
 

Author Comment

by:Seamus2626
ID: 40257964
Ron, passes this spreasdheet onto other users, so cant guarantee that they will have links auto updating

Rgonzo, i stuck that in the editor and was still asked to update links on entry....
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 34

Expert Comment

by:Rob Henson
ID: 40257986
Doing it by macro - can't guarantee that other users will enable macros.

Either way, you still have to rely on user clicking the Enable Content button.

Thanks
Rob
0
 

Author Comment

by:Seamus2626
ID: 40257994
All users do have macros enabled....
0
 

Author Comment

by:Seamus2626
ID: 40257996
Ive went to town with protection, ive turned my options on as above to enable updates and im still getting a warning message!

Private Sub Workbook_Open()

ActiveSheet.Unprotect ("football")


Application.AskToUpdateLinks = False
Application.DisplayAlerts = False



    Dim blnSUpdating    As Boolean
    
    With Application
        blnSUpdating = .ScreenUpdating
        .ScreenUpdating = False
    End With
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources

Application.ScreenUpdating = blnSUpdating

Application.DisplayAlerts = True
Application.AskToUpdateLinks = True


ActiveSheet.Protect ("football")


End Sub

Open in new window

0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 40258002
Where are you putting the Workbook_Open sub?

It has to be on the ThisWorkbook module.

Thanks
Rob
0
 
LVL 34

Expert Comment

by:Rob Henson
ID: 40258009
I guess we are looking at the order that things are processed when a workbook opens.

1)Update Links
2)Workbook_Open Sub

or

1)Workbook_Open Sub
2)Update Links

As the Update Links is a General Option, ie at application level and not Workbook specific, I suspect it does this check first then once the Workbook is open it will run the Workbook_Open routine.

Thanks
Rob H
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question