View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Moseley Alan Moseley is offline
external usenet poster
 
Posts: 75
Default why won't this work?

From the help file, the Workbooks property:-

Returns a Workbooks collection that represents all the open workbooks.

Try changing your line to:-

With Workbooks.Open("G:\filepath\filepath\file.xls")

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"PBcorn" wrote:

The below gives error 9: subscript out of range (when error handling is not
used). I thought it might be to do with workbooks(path), but not sure. It is
located in the ThisWorkbook object.



Private Sub workbook_open()

'sub to force intermediate xlwb to update its links without opening it

'Dim msg As String

On Error GoTo ms

with Workbooks("G:\filepath\filepath\file.xls")

.UpdateLink Name:=.LinkSources

end with

Exit Sub

ms:
msg = "links may have not updated properly" & vbNewLine
msg = msg & "open relevant file"
MsgBox msg


End Sub