Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Open xls file from xls file in same session

Hi all,
I've an excel-macro (in a Excel-file, say "A") which create a new excel-file
(say "B"); at end of macro (in file A) I open new file (B) created with:
shell(path_xls & " " & new_xlsfile)

where new_xlsfile contains path and name of my new xls file, and path_xls is
like:
C:\Programmi\MicrosoftOffice2003\Office11\excel.ex e

All works fine, but new file is open in a "new excel session", so isn't
possible use function like "copy or move worksheet" from new file (B) to
other opened files (for ex, to A).

My question: there is a way to open my new file (B) in same "excel-session"
of caller-file (B)?
Thanks in advance
JFM


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 274
Default Open xls file from xls file in same session

Use Woorkbooks.Open:

WorkBooks.Open(path_xls & " " & new_xlsfile)

should do it - then workbook B will be part of the workbooks
collection.
The notion you were getting at with "excel sessions" is often called
"instance" - you want both workbooks open in the same instance of the
application object.

Hope that helps

-John Coleman

On Feb 11, 4:35 am, "Andrea" wrote:
Hi all,
I've an excel-macro (in a Excel-file, say "A") which create a new excel-file
(say "B"); at end of macro (in file A) I open new file (B) created with:
shell(path_xls & " " & new_xlsfile)

where new_xlsfile contains path and name of my new xls file, and path_xls is
like:
C:\Programmi\MicrosoftOffice2003\Office11\excel.ex e

All works fine, but new file is open in a "new excel session", so isn't
possible use function like "copy or move worksheet" from new file (B) to
other opened files (for ex, to A).

My question: there is a way to open my new file (B) in same "excel-session"
of caller-file (B)?
Thanks in advance
JFM



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Open xls file from xls file in same session

Hi John,
thanks very much, you solved my problem; your solution is exactly what I'm
looking for and is working fine!
And thanks also for your specification about notion of "instance".
Thanks very much again! Have a nice sunday.
JFM


"John Coleman" ha scritto nel messaggio
oups.com...
Use Woorkbooks.Open:

WorkBooks.Open(path_xls & " " & new_xlsfile)

should do it - then workbook B will be part of the workbooks
collection.
The notion you were getting at with "excel sessions" is often called
"instance" - you want both workbooks open in the same instance of the
application object.

Hope that helps

-John Coleman

On Feb 11, 4:35 am, "Andrea" wrote:
Hi all,
I've an excel-macro (in a Excel-file, say "A") which create a new

excel-file
(say "B"); at end of macro (in file A) I open new file (B) created with:
shell(path_xls & " " & new_xlsfile)

where new_xlsfile contains path and name of my new xls file, and

path_xls is
like:
C:\Programmi\MicrosoftOffice2003\Office11\excel.ex e

All works fine, but new file is open in a "new excel session", so isn't
possible use function like "copy or move worksheet" from new file (B) to
other opened files (for ex, to A).

My question: there is a way to open my new file (B) in same

"excel-session"
of caller-file (B)?
Thanks in advance
JFM





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
Open xls file from other xls-file in same session Andrea Excel Discussion (Misc queries) 1 February 11th 07 01:26 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Make it so a new session of Excel opens with each file in 2002? Scott Excel Discussion (Misc queries) 3 February 7th 06 05:35 PM
Open an Excel file in a new Excel session Tetsuya Oguma[_4_] Excel Programming 1 April 25th 05 08:54 AM


All times are GMT +1. The time now is 09:30 AM.

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"