ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Update Links (https://www.excelbanter.com/excel-programming/354801-update-links.html)

Steph[_6_]

Update Links
 
Hi. How can adjust the following line of code to update links?

Set WB = Workbooks.Open(Filename:=OneFile.path)

I tried Set WB = Workbooks.Open(Filename:=OneFile.path), Update Links:=1
but that didn't work.

Thanks!




NickHK

Update Links
 
Steph,
By "that didn't work" you mean the line was red and would not compile ?
That is generally a hint that there is a syntax error.
Brackets of a function/method need contain all its arguments.
(N.B. not in this case, but if you are NOT assigning the return value, do
not include the brackets.)

Not sure what OneFile is, but I would assume a workbook. If so, then
OneFile.path will evaluate to a folder; you cannot open a folder in Excel.
You would need something like [OneFile.Path & "TwoFile.xls"].

Also the named arguments are single words; so "updatelinks", no space.
Read
http://msdn.microsoft.com/library/en...procedures.asp
for these help on these.

NickHK

"Steph" wrote in message
...
Hi. How can adjust the following line of code to update links?

Set WB = Workbooks.Open(Filename:=OneFile.path)

I tried Set WB = Workbooks.Open(Filename:=OneFile.path), Update Links:=1
but that didn't work.

Thanks!







All times are GMT +1. The time now is 05:41 PM.

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