Subscript out of range

B

Bill Murphy

I have an application consisting of two open workbooks. The first workbook
opens, then opens the second workbook. The second workbook contains very
little VBA code, just the following:

Private Sub Workbook_Open()

ThisWorkbook.RefreshAll

End Sub

When the End Sub is reached I get the error message Run-time error 9 -
Subscript out of range.

The purpose of the second workbook is to import a table from a mainframe,
which is then used by the first workbook using Vlookup. I would like to
have the application automatically reactivate the first workbook once the
second workbook has finished it's import and refreshed.

Any ideas are welcome.

Bill
 
N

Nigel

I have an application consisting of two open workbooks. The first
workbook
opens, then opens the second workbook. The second workbook contains very
little VBA code, just the following:

Doesn't take much to cause VBA to throw an error!
Private Sub Workbook_Open()

ThisWorkbook.RefreshAll

End Sub

When the End Sub is reached I get the error message Run-time error 9 -
Subscript out of range.

Do you mean this end sub or some other part of the code?
The purpose of the second workbook is to import a table from a mainframe,
which is then used by the first workbook using Vlookup. I would like to
have the application automatically reactivate the first workbook once the
second workbook has finished it's import and refreshed.

When are you doing this, is this before the error or after?
Any ideas

Suggest you submit the code for closer inspection

Cheers
Nigel
 

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