Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#12
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#13
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#14
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
open spreadsheets into separate excel instance | Excel Discussion (Misc queries) | |||
How to open a new instance of EXCEL and .xls file | Excel Worksheet Functions | |||
open excel in a separate instance | Excel Discussion (Misc queries) | |||
Open files within one instance of Excel | Setting up and Configuration of Excel | |||
How do I set up Excel to open a new instance/application window w. | Excel Discussion (Misc queries) |