Open a file in another Workbook

P

Philosophaie

Dim XLApp As Excel.Application
Dim XLBook As Excel.Workbook
Set XLApp = CreateObject("Excel.Application")

'how do you word the opening of another preexisting file different than
'the current activesheet using Early binding? How do you link the two?
I tried:
'XLApp.Open ("c:\path\file.xls")
'XLApp.XLBook.Open ("c:\path\file.xls") they did not work


I also want to do the same for Access:

Dim AccApp As Access.Application

or something similar plus be able to manipulate the data from Excel to
Access would be nice.
 
C

Chip Pearson

Try

Set XLBook = XLApp.Workbooks.Open ("C:\path\file.xls")

If all you need to do with your Access data is to query and/or change
records in a database, you can simply access the database directly via
ADO. You don't need to go through the Access application at all.

Cordially,
Chip Pearson
Microsoft MVP 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com
[email on web site]
 

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