Cannot Update Links ??

D

dim

Hi, I have one workbook (StartupBook.xls) opening another (MyProgram.xls) so
that I can use the 'RunAuto Macro' command when a 'Start' button located ona
userform is clicked in StartupBook.xls.

When the start button is clicked I open a number of workbooks, followed by
finally MyProgram.xls which contains links to the ones opened before it. This
allowed MyProgram.xls to update its links fine when all the workbooks were in
a pre-determined folder.

However, I recently changed all the VBA paths to variation of the
ThisWorkbook.Path & .... command to allow the program to go anywhere on the
hard drive.

I have moved the program folder 'MyFolder' to a new location on the hard
drive. It seems to run fine, apart from the opening sequence upon the Start
button being clicked, when the MyProgram.xls file has a problem updating its
links.

Below is the code of the Start button macro. Can anyone tell me why my links
are no longer updating?

It is only 2.xls, 3.xls, 4.xls and 74.xls that the problem is with. The
excel error box says they have an "undefined or non-rectangular name".

Please Help!!! :-(

Private Sub CommandButton1_Click()
Me.Hide
ActiveWorkbook.Save
Application.ScreenUpdating = False
Workbooks.Open ThisWorkbook.Path & "\Data\2.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\3.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\4.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\74.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\1.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\70.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\69.xls"
Workbooks.Open ThisWorkbook.Path & "\Data\71.xls"
Workbooks.Open ThisWorkbook.Path & "\Main\MyProgram.xls", UpdateLinks:=3

ActiveWorkbook.RunAutoMacros xlAutoOpen
ThisWorkbook.Close
Unload Me
End Sub
 

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