How To Open A Workbook And Have A Second Workbook Open Automatically

  • Thread starter Thread starter Minitman
  • Start date Start date
M

Minitman

Greetings

I have a workbook that is used to enter invoices and customer
information. I split the invoices and customer information from the
main workbook and now I am converting all of the formulas so they work
again.

One thing I would like to have working is to have the customer
information workbook (CI.xls with only 1 sheet - CI) and the invoice
workbook (INV.xls with only 1 sheet) to open when I open the main
Entry.xls workbook. I suspect it is some kind of change event, But I
don't know which one or where to place it.

Any help would be most appreciated.

TIA.

-Minitman
 
Put the following code into ThisWorkbook (use VBA editor, Project Explorer
select your Entry.xls workbook and double click ThisWorkbook). Change the
paths below to where your files are stored.

Private Sub Workbook_Open()
On Error Resume Next
Workbooks.Open Filename:="C:\CI.xls"
Workbooks.Open Filename:="C:\INV.xls"
End Sub

Cheers
Nigel
 
Worth adding a line to make the main workbook active
after opening the other two...

Private Sub Workbook_Open()
On Error Resume Next
Workbooks.Open Filename:="C:\CI.xls"
Workbooks.Open Filename:="C:\INV.xls"
ThisWorkbook.Activate
End Sub


As you're using the the workbooks basically as database
tables, then perhaps your application is more
appropriately placed in an M Access database?
You can inport tables very easily from Excel into Access

As an alterbative, you can also get data from andpush
data into closed excel workbooks using ADO if they're
being used as you are.

Patrick Molloy
Microsoft Excel MVP
 
Hey Nigel,

This looks great. I can't wait to try it out.

Thanks.

-Minitman
 
Hey Patrick,

Thanks for the added line, it looks like a great addin!

-Minitman
 
Hey Patrick,

I just tried this code and I got an "Out of memory" error?????

What do I do with that?

-Minitman
 

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

Back
Top