updating Excel links from Access

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
 
K

Ken Snell [MVP]

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?
 
A

Alex

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
 
K

Ken Snell [MVP]

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.
 
A

Alex

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
 

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