updating Excel links from Access

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I'm trying to update links but getting the following error:

Dim xlapp1 As New Excel.Application
Dim xlbook1 As New Excel.Workbook

Set xlbook1 = xlapp1.Workbooks.Open(strFileName)

With xlbook1

.UpdateLink Name:=xlbook1.LinkSources ' error

End With

Error: "Error number 1004: Application-defined or object-
defined error"

Could anybody help me with this?

Thanks
 
There is an argument in the Workbooks.Open method that allows you to have
the book update the links when the file is opened. Off top of my head, I
think it's the third argument?
 
Thanks a lot, Ken.
But, after that I'm opening many other workbooks
associated with this xlbook1 and want to trigger this
links' updating once again.

Regards,

Alex
 
I am not familiar with this EXCEL method in code. What you've posted appears
to be consistent with the Help example that I see in EXCEL's VBA Help.

I recommend that you post your question in an EXCEL newsgroup.
 
Thanks again, Ken.
It looks like it was a problem with some links corrupted.
After I've fixed it, everything is going well now.

Regards,

Alex
 
Back
Top