Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i open a new instance Excel?

How do I open excel workbook in its own instance of Excel. When I have Excel
running and open another Excel workbook file (with an .xls extension) it is
opened in the instance I have running. So, when I exit Excel both workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program because I
shows the hidden file and will close it if the instance is closed. If I open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new instance?
--
Mike Reed
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default How do i open a new instance Excel?

Micheal try,

Dim xlApp as Excel.Application
set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Open FileName:="C:\Book1.xls"


Fred

"Michael D. Reed" wrote in message
...
How do I open excel workbook in its own instance of Excel. When I have
Excel
running and open another Excel workbook file (with an .xls extension) it
is
opened in the instance I have running. So, when I exit Excel both
workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program because
I
shows the hidden file and will close it if the instance is closed. If I
open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new instance?
--
Mike Reed



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default How do i open a new instance Excel?

Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?

(typically a
"Fred" <leavemealone@home wrote in message
...
Micheal try,

Dim xlApp as Excel.Application
set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Open FileName:="C:\Book1.xls"


Fred

"Michael D. Reed" wrote in message
...
How do I open excel workbook in its own instance of Excel. When I have
Excel
running and open another Excel workbook file (with an .xls extension) it
is
opened in the instance I have running. So, when I exit Excel both
workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program
because I
shows the hidden file and will close it if the instance is closed. If I
open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new
instance?
--
Mike Reed





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do i open a new instance Excel?

"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?



The code ONLY loads the designated workbook (Book1.xls). AddIns and files in
the XLStart folder, such as Personal.xls, do not get loaded.Consequently,
the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default How do i open a new instance Excel?

Hi William,

See also MSKB 213489:
Add-Ins Don't Load When Using the CreateObject Command

http://support.microsoft.com/default...b;en-us;213489

---
Regards,
Norman



"Norman Jones" wrote in message
...
"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?



The code ONLY loads the designated workbook (Book1.xls). AddIns and files
in the XLStart folder, such as Personal.xls, do not get
loaded.Consequently, the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default How do i open a new instance Excel?

I see. As an interesting side note, but in keeping with my original question
(you answered why Personal doesn't open, but missed the heart of my concern)
it opens any unopen file without warnings about read-only (or macros, for
that matter). In fact, if the calling procedure is from a file with macros
enabled, you will not be asked if you want the called file to be opened with
or without macros.

This produced an interesting (please don't try this with any other apps
running and I suggest saving all your work cuz ya gonna need to shut down
the HARD WAY) effect: I put Fred's code into the Workbook_Open sub of the
file Book1 on C: and it called itself recursively when opened ... I was
given only one chance to say Yes/No to macros, then BOOM.

I repeat, I wouldn't try it.

And I have learned NEVER EVER EVER say Yes to macros the first time you open
a file ... and be sure to look at ALL the code before you ever try it WITH
macros enabled.

Thanks,

Bill

"Norman Jones" wrote in message
...
Hi William,

See also MSKB 213489:
Add-Ins Don't Load When Using the CreateObject Command

http://support.microsoft.com/default...b;en-us;213489

---
Regards,
Norman



"Norman Jones" wrote in message
...
"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?



The code ONLY loads the designated workbook (Book1.xls). AddIns and files
in the XLStart folder, such as Personal.xls, do not get
loaded.Consequently, the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman





  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default How do i open a new instance Excel?

It obviously opens unopen files without warnings about read-only, but what I
meant to write is it ALSO opens ALREADY OPENED files without read-only
warnings, in the new instances of Excel...

"William Benson" wrote in message
...
I see. As an interesting side note, but in keeping with my original
question (you answered why Personal doesn't open, but missed the heart of
my concern) it opens any unopen file without warnings about read-only (or
macros, for that matter). In fact, if the calling procedure is from a file
with macros enabled, you will not be asked if you want the called file to
be opened with or without macros.

This produced an interesting (please don't try this with any other apps
running and I suggest saving all your work cuz ya gonna need to shut down
the HARD WAY) effect: I put Fred's code into the Workbook_Open sub of the
file Book1 on C: and it called itself recursively when opened ... I was
given only one chance to say Yes/No to macros, then BOOM.

I repeat, I wouldn't try it.

And I have learned NEVER EVER EVER say Yes to macros the first time you
open a file ... and be sure to look at ALL the code before you ever try it
WITH macros enabled.

Thanks,

Bill

"Norman Jones" wrote in message
...
Hi William,

See also MSKB 213489:
Add-Ins Don't Load When Using the CreateObject Command

http://support.microsoft.com/default...b;en-us;213489

---
Regards,
Norman



"Norman Jones" wrote in message
...
"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?


The code ONLY loads the designated workbook (Book1.xls). AddIns and
files in the XLStart folder, such as Personal.xls, do not get
loaded.Consequently, the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman







  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How do i open a new instance Excel?

This addresses only the part about macro warnings. That lack of
warning is by design (and configurable). When code opens a workbook
containing macros, it is subject to the AutomationSecurity property.
The default value of that property is msoAutomationSecurityLow.

My guess is that MS decided that if you trust the code that is
currently running, you trust any code that it, the currently executing
code, chooses to invoke.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , wbenson1
@nycap.rr.com says...
I see. As an interesting side note, but in keeping with my original question
(you answered why Personal doesn't open, but missed the heart of my concern)
it opens any unopen file without warnings about read-only (or macros, for
that matter). In fact, if the calling procedure is from a file with macros
enabled, you will not be asked if you want the called file to be opened with
or without macros.

This produced an interesting (please don't try this with any other apps
running and I suggest saving all your work cuz ya gonna need to shut down
the HARD WAY) effect: I put Fred's code into the Workbook_Open sub of the
file Book1 on C: and it called itself recursively when opened ... I was
given only one chance to say Yes/No to macros, then BOOM.

I repeat, I wouldn't try it.

And I have learned NEVER EVER EVER say Yes to macros the first time you open
a file ... and be sure to look at ALL the code before you ever try it WITH
macros enabled.

Thanks,

Bill

"Norman Jones" wrote in message
...
Hi William,

See also MSKB 213489:
Add-Ins Don't Load When Using the CreateObject Command

http://support.microsoft.com/default...b;en-us;213489

---
Regards,
Norman



"Norman Jones" wrote in message
...
"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?


The code ONLY loads the designated workbook (Book1.xls). AddIns and files
in the XLStart folder, such as Personal.xls, do not get
loaded.Consequently, the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman






  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i open a new instance Excel?

Using create object did not work. I may be in the wrong group but this is
what I am doing.
I am opening an Excel workbook from a VB.NET program using:
_myApplaction = New Excel.Application
_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)
I also tried
_myApplaction = CreateObject("Excel.Application")

_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)

In both cases if I open a workbook file it uses the running Excel instance
you can see this by looking at the Windows menu, both files are listed there.

If I open Excel and then open the workbook, it is in a new instance in each
instance the Windows menu will only show one workbook.
Is there a way to tell excel to open a new instance when a workbook file is
opened, preferably programmability.

--
Mike Reed


"Fred" wrote:

Micheal try,

Dim xlApp as Excel.Application
set xlApp = CreateObject("Excel.Application")
xlApp.Visible = True
xlApp.Workbooks.Open FileName:="C:\Book1.xls"


Fred

"Michael D. Reed" wrote in message
...
How do I open excel workbook in its own instance of Excel. When I have
Excel
running and open another Excel workbook file (with an .xls extension) it
is
opened in the instance I have running. So, when I exit Excel both
workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program because
I
shows the hidden file and will close it if the instance is closed. If I
open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new instance?
--
Mike Reed




  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default How do i open a new instance Excel?

Maybe, there is some option in XL that I have long since forgotten but
if not using CreateObject is SOP for starting a new instance of XL.
Another possibility is that .Net is doing something different.

One way to narrow down the source of the problem would be to
instantiate a new copy of XL from VB or from VBA running in another
Office program or from VBA running in XL itself. If VB/A works fine
then you can safely focus your attention on the .Net interface. If it
doesn't there's something about that machine / copy of XL.

One final note. You may want to ensure you have the latest support
release for your version of XL.


--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
am says...
Using create object did not work. I may be in the wrong group but this is
what I am doing.
I am opening an Excel workbook from a VB.NET program using:
_myApplaction = New Excel.Application
_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)
I also tried
_myApplaction = CreateObject("Excel.Application")

_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)

In both cases if I open a workbook file it uses the running Excel instance
you can see this by looking at the Windows menu, both files are listed there.

If I open Excel and then open the workbook, it is in a new instance in each
instance the Windows menu will only show one workbook.
Is there a way to tell excel to open a new instance when a workbook file is
opened, preferably programmability.




  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i open a new instance Excel?

It has something to do with how the XP launches a file associated with an
exe. If I click on or choose, open form the context menu in the file
explorer the workbook is loaded into the most recently launched instance of
Excel or if I launch the file alone form the command line it is put into the
most recently launched instance of Excel. If I launch Excel and then load
the file I get a separate instance of Excel or if I launce excel from the
command line with the file as a command line argument I get a second instance
of excel.
I know .NET launches a new instance of Excel because I can wind up with
several running. I can verify this by the tasks manager. I will have
several Excels running that I need to explicitly end them.
A quick check of Word and Visio; Visio is similar Excel and Word is
different. Word under the Windows menu you can see all the running documents
but closing there window only closes the one document.

--
Mike Reed


"Tushar Mehta" wrote:

Maybe, there is some option in XL that I have long since forgotten but
if not using CreateObject is SOP for starting a new instance of XL.
Another possibility is that .Net is doing something different.

One way to narrow down the source of the problem would be to
instantiate a new copy of XL from VB or from VBA running in another
Office program or from VBA running in XL itself. If VB/A works fine
then you can safely focus your attention on the .Net interface. If it
doesn't there's something about that machine / copy of XL.

One final note. You may want to ensure you have the latest support
release for your version of XL.


--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
am says...
Using create object did not work. I may be in the wrong group but this is
what I am doing.
I am opening an Excel workbook from a VB.NET program using:
_myApplaction = New Excel.Application
_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)
I also tried
_myApplaction = CreateObject("Excel.Application")

_myWorkbook = ._myApplaction.Workbooks.Open(ExcelWorkbookPath)

In both cases if I open a workbook file it uses the running Excel instance
you can see this by looking at the Windows menu, both files are listed there.

If I open Excel and then open the workbook, it is in a new instance in each
instance the Windows menu will only show one workbook.
Is there a way to tell excel to open a new instance when a workbook file is
opened, preferably programmability.



  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default How do i open a new instance Excel?

Hi Mike,

I agree with Tushar's suggestion.
Can you so kind to describe your goal detailed?
If you want to open the xls file in a new excel.exe instance, you may try
to CreateObject and use the created instance to open the excel file.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 112
Default How do i open a new instance Excel?

Is there a way to tell the system to open a new Excel file in a new instance?

Yes. Application.IgnoreRemoteRequests = True


Regards,
Vic Eldridge




"Michael D. Reed" wrote:

How do I open excel workbook in its own instance of Excel. When I have Excel
running and open another Excel workbook file (with an .xls extension) it is
opened in the instance I have running. So, when I exit Excel both workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program because I
shows the hidden file and will close it if the instance is closed. If I open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new instance?
--
Mike Reed

  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i open a new instance Excel?

Vic
That worked! How did you find that out? It not documented in the app
object for Excel. Infect when I look for "IgnoreRemoteRequests" in help it
did not show up. It looks like a hangover from the DDE days. I did not see
it in the intelligence scene list until you pointed it out.
Thank you,
--
Mike Reed


"Vic Eldridge" wrote:

Is there a way to tell the system to open a new Excel file in a new instance?


Yes. Application.IgnoreRemoteRequests = True


Regards,
Vic Eldridge




"Michael D. Reed" wrote:

How do I open excel workbook in its own instance of Excel. When I have Excel
running and open another Excel workbook file (with an .xls extension) it is
opened in the instance I have running. So, when I exit Excel both workbooks
are closed. This is a problem when for a program that has a hidden Excel
workbook running. If I start another Excel file, it uses the instance of
Excel the program is using. This causes a problem for the program because I
shows the hidden file and will close it if the instance is closed. If I open
an instance of Excel then load the file, I get new instance of Excel. Is
there a way to tell the system to open a new Excel file in a new instance?
--
Mike Reed



  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default How do i open a new instance Excel?

Hi

This is included in the excel vba help file.
<Program Files\Microsoft Office\OFFICE11\1033\VBAXL10.CHM

IgnoreRemoteRequests Property
See AlsoApplies ToExampleSpecifics
True if remote DDE requests are ignored. Read/write Boolean.

Example
This example sets the IgnoreRemoteRequests property to True so that remote
DDE requests are ignored.

Application.IgnoreRemoteRequests = True




Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default How do i open a new instance Excel?

Peter Thank you,
Under the €śno question is a dumb question department can one assume that
the object model in VBA is reflected through to the .NET
Microsoft.Office.Interop.Excel?
--
Mike Reed


""Peter Huang" [MSFT]" wrote:

Hi

This is included in the excel vba help file.
<Program Files\Microsoft Office\OFFICE11\1033\VBAXL10.CHM

IgnoreRemoteRequests Property
See AlsoApplies ToExampleSpecifics
True if remote DDE requests are ignored. Read/write Boolean.

Example
This example sets the IgnoreRemoteRequests property to True so that remote
DDE requests are ignored.

Application.IgnoreRemoteRequests = True




Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.


  #18   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 225
Default How do i open a new instance Excel?

Hi

Yes.
Acutally the Interop.Excel.dll is an .NET wrap for the Excel.EXE COM Object
Modal.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

  #19   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 230
Default How do i open a new instance Excel?

Took me forever to get around to revisiting this thread ... but thanks for
the heads up about AutomationSecurity.

"Tushar Mehta" wrote in message
om...
This addresses only the part about macro warnings. That lack of
warning is by design (and configurable). When code opens a workbook
containing macros, it is subject to the AutomationSecurity property.
The default value of that property is msoAutomationSecurityLow.

My guess is that MS decided that if you trust the code that is
currently running, you trust any code that it, the currently executing
code, chooses to invoke.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article , wbenson1
@nycap.rr.com says...
I see. As an interesting side note, but in keeping with my original
question
(you answered why Personal doesn't open, but missed the heart of my
concern)
it opens any unopen file without warnings about read-only (or macros, for
that matter). In fact, if the calling procedure is from a file with
macros
enabled, you will not be asked if you want the called file to be opened
with
or without macros.

This produced an interesting (please don't try this with any other apps
running and I suggest saving all your work cuz ya gonna need to shut down
the HARD WAY) effect: I put Fred's code into the Workbook_Open sub of
the
file Book1 on C: and it called itself recursively when opened ... I was
given only one chance to say Yes/No to macros, then BOOM.

I repeat, I wouldn't try it.

And I have learned NEVER EVER EVER say Yes to macros the first time you
open
a file ... and be sure to look at ALL the code before you ever try it
WITH
macros enabled.

Thanks,

Bill

"Norman Jones" wrote in message
...
Hi William,

See also MSKB 213489:
Add-Ins Don't Load When Using the CreateObject Command

http://support.microsoft.com/default...b;en-us;213489

---
Regards,
Norman



"Norman Jones" wrote in message
...
"William Benson" wrote in message
...
Any idea why this opens an instance without the message that certain
workbooks are already locked for editing (e.g., Personal.XLS)?


The code ONLY loads the designated workbook (Book1.xls). AddIns and
files
in the XLStart folder, such as Personal.xls, do not get
loaded.Consequently, the question of locked files does not arise.

Hit Alt-F11 and look at the files in the VBE.

---
Regards,
Norman








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 spreadsheets into separate excel instance David Blaine Fullerton Excel Discussion (Misc queries) 1 September 7th 08 02:31 AM
How to open a new instance of EXCEL and .xls file Launchnet Excel Worksheet Functions 10 June 19th 07 03:45 PM
open excel in a separate instance Eric Excel Discussion (Misc queries) 0 March 9th 07 08:01 PM
Open files within one instance of Excel kopa999 Setting up and Configuration of Excel 1 March 22nd 06 11:40 PM
How do I set up Excel to open a new instance/application window w. DK9144 Excel Discussion (Misc queries) 1 February 21st 05 04:34 PM


All times are GMT +1. The time now is 12:21 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"