Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
While a long macro is running in Excel 2002 VBA, and a user opens another
Excel document on the PC, or opens an excel attachment in an email, I would like to prevent these Excel documents opening in the same session/instance as the one in which the macro is running, and start a new instance of Excel if necessary. Is there any way in VBA to control this? --Kiloran |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Just an idea.. but it seems to work :) code must run in a class module..(which could be Thisworkbook if the xlApp is instantiated then the event handler will create a new instance. Option Explicit Dim WithEvents xlApp As Application Sub LockAPP() Set xlApp = New Application End Sub Private Sub xlApp_WorkbookOpen(ByVal Wb As Workbook) Dim newApp As Object Set newApp = CreateObject("Excel.Application") newApp.Workbooks.Open Wb.FullName End Sub -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Kiloran wrote : While a long macro is running in Excel 2002 VBA, and a user opens another Excel document on the PC, or opens an excel attachment in an email, I would like to prevent these Excel documents opening in the same session/instance as the one in which the macro is running, and start a new instance of Excel if necessary. Is there any way in VBA to control this? --Kiloran |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In tools=Options in the general tab, select Ignore Other applications.
Application.IgnoreRemoteRequests = True in VBA -- Regards, Tom Ogilvy "Kiloran" wrote in message ... While a long macro is running in Excel 2002 VBA, and a user opens another Excel document on the PC, or opens an excel attachment in an email, I would like to prevent these Excel documents opening in the same session/instance as the one in which the macro is running, and start a new instance of Excel if necessary. Is there any way in VBA to control this? --Kiloran |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Brilliant! Just what I needed.
Many thanks Tom, you have an enviable knowledge of VBA --Kiloran "Tom Ogilvy" wrote in message ... In tools=Options in the general tab, select Ignore Other applications. Application.IgnoreRemoteRequests = True in VBA -- Regards, Tom Ogilvy "Kiloran" wrote in message ... While a long macro is running in Excel 2002 VBA, and a user opens another Excel document on the PC, or opens an excel attachment in an email, I would like to prevent these Excel documents opening in the same session/instance as the one in which the macro is running, and start a new instance of Excel if necessary. Is there any way in VBA to control this? --Kiloran |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel (Session) Hijacking problem | Excel Discussion (Misc queries) | |||
Startup and template locations in Citrix TS session and local session | Setting up and Configuration of Excel | |||
Using alt-tab to switch between Excel workbooks under the same session | Excel Discussion (Misc queries) | |||
Each New Excel to open in another session | Excel Worksheet Functions | |||
Can't alt-tab between Excel workbooks in one session. Help! | Excel Discussion (Misc queries) |