Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Open a file in another Workbook

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Open a file in another Workbook



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]



On Fri, 12 Mar 2010 14:05:01 -0800, Philosophaie
wrote:

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.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel 2003 saved file will not open without a blank workbook open Bob Excel Discussion (Misc queries) 4 November 11th 06 04:24 PM
One workbook file will not open in Excel T2010 Excel Worksheet Functions 0 January 8th 06 05:05 AM
in excel when I open my workbook the file name is followed ls50317 Excel Discussion (Misc queries) 1 February 9th 05 08:29 PM
second file/Workbook open Alvin Hansen[_2_] Excel Programming 3 January 30th 05 08:35 PM
VBA for XL95, Workbook.open non XL-file Dick Kusleika[_2_] Excel Programming 0 September 6th 03 02:49 AM


All times are GMT +1. The time now is 03:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"