Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Automation Application is shared with interactive?

I have a VBScript that is creating an Excel.Application object and writing to
workbooks\worksheets in the background. This operation takes hours to
complete and if I open a spreadsheet to do other work while my script is
running, this other workbook opens in the application window my script
created. This causes my script to fail when it attempts to control the
Application object. How can I prevent any other interaction with the
Application object my script creates? I want to automatically open a new
Application window when I manually open a workbook. Hope this makes sense
and someone can tell me how to fix this. Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Excel Automation Application is shared with interactive?

Hi Huey,

Try Hiding the instance of Excel:

'=============
Public Sub Tester()
Dim oApp As Object
Dim oWB As Object

Set oApp = CreateObject("Excel.Application")
Set oWB = oApp.Workbooks.Open("C:\MyBook.xls")
oApp.Visible = False

'Your code

End Sub
'<<=============


---
Regards,
Norman


"Huey" wrote in message
...
I have a VBScript that is creating an Excel.Application object and writing
to
workbooks\worksheets in the background. This operation takes hours to
complete and if I open a spreadsheet to do other work while my script is
running, this other workbook opens in the application window my script
created. This causes my script to fail when it attempts to control the
Application object. How can I prevent any other interaction with the
Application object my script creates? I want to automatically open a new
Application window when I manually open a workbook. Hope this makes
sense
and someone can tell me how to fix this. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Automation Application is shared with interactive?

Norman, It is hidden to begin with. But it becomes visible when I manually
open a different workbook. What I am hoping for is some setting in the Excel
application object that will make it "private" so that no other processes can
interact with it.

"Norman Jones" wrote:

Hi Huey,

Try Hiding the instance of Excel:

'=============
Public Sub Tester()
Dim oApp As Object
Dim oWB As Object

Set oApp = CreateObject("Excel.Application")
Set oWB = oApp.Workbooks.Open("C:\MyBook.xls")
oApp.Visible = False

'Your code

End Sub
'<<=============


---
Regards,
Norman


"Huey" wrote in message
...
I have a VBScript that is creating an Excel.Application object and writing
to
workbooks\worksheets in the background. This operation takes hours to
complete and if I open a spreadsheet to do other work while my script is
running, this other workbook opens in the application window my script
created. This causes my script to fail when it attempts to control the
Application object. How can I prevent any other interaction with the
Application object my script creates? I want to automatically open a new
Application window when I manually open a workbook. Hope this makes
sense
and someone can tell me how to fix this. Thanks.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Excel Automation Application is shared with interactive?

Hi Huey,

'-----------------
Norman, It is hidden to begin with. But it becomes visible when I manually
open a different workbook. What I am hoping for is some setting in the
Excel
application object that will make it "private" so that no other processes
can
interact with it.
'-----------------

How did you open a workbook manually in a hidden
instance of Excel?


---
Regards,
Norman


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Automation Application is shared with interactive?

That's what I want to know. All I do is double-click on a spreadsheet either
from a file browser or as an attachement from an email and it pops up in the
application object that my script created.

I did find that there is an Application.Interactive property I could set to
False but the Help information reads like this only disables input from the
user and so I might just hose myself if I set this to False in my script.
I'm at home now so I can't easily try this on my script so I'll check back in
tomorrow.

"Norman Jones" wrote:

Hi Huey,

'-----------------
Norman, It is hidden to begin with. But it becomes visible when I manually
open a different workbook. What I am hoping for is some setting in the
Excel
application object that will make it "private" so that no other processes
can
interact with it.
'-----------------

How did you open a workbook manually in a hidden
instance of Excel?


---
Regards,
Norman





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Excel Automation Application is shared with interactive?

I found that others have been able to do what I want by using this :

Application.IgnoreRemoteRequests = True

This will stop any new workbooks from opening in the Application object
referred to in the above code.

I thank you. ;]

"Huey" wrote:

That's what I want to know. All I do is double-click on a spreadsheet either
from a file browser or as an attachement from an email and it pops up in the
application object that my script created.

I did find that there is an Application.Interactive property I could set to
False but the Help information reads like this only disables input from the
user and so I might just hose myself if I set this to False in my script.
I'm at home now so I can't easily try this on my script so I'll check back in
tomorrow.

"Norman Jones" wrote:

Hi Huey,

'-----------------
Norman, It is hidden to begin with. But it becomes visible when I manually
open a different workbook. What I am hoping for is some setting in the
Excel
application object that will make it "private" so that no other processes
can
interact with it.
'-----------------

How did you open a workbook manually in a hidden
instance of Excel?


---
Regards,
Norman



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Excel Automation Application is shared with interactive?

Yes, that will refuse DDE requests, like those from Explorer etc., so WBs
will open in another instance of Excel.
Your instance is not immune from interaction with COM, but someone/some app
would (normally) have to go looking for your instance, although GetObject
could return it.

NickHK

"Huey" wrote in message
...
I found that others have been able to do what I want by using this :

Application.IgnoreRemoteRequests = True

This will stop any new workbooks from opening in the Application object
referred to in the above code.

I thank you. ;]

"Huey" wrote:

That's what I want to know. All I do is double-click on a spreadsheet

either
from a file browser or as an attachement from an email and it pops up in

the
application object that my script created.

I did find that there is an Application.Interactive property I could set

to
False but the Help information reads like this only disables input from

the
user and so I might just hose myself if I set this to False in my

script.
I'm at home now so I can't easily try this on my script so I'll check

back in
tomorrow.

"Norman Jones" wrote:

Hi Huey,

'-----------------
Norman, It is hidden to begin with. But it becomes visible when I

manually
open a different workbook. What I am hoping for is some setting in

the
Excel
application object that will make it "private" so that no other

processes
can
interact with it.
'-----------------

How did you open a workbook manually in a hidden
instance of Excel?


---
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
What gives... Application.Interactive = false Kieranz[_2_] Excel Programming 3 March 5th 07 03:58 PM
Interactive Workbook on Shared Drive J.W. Aldridge[_2_] Excel Programming 0 August 11th 06 03:19 PM
Application.Interactive=true ignored? John.Greenan Excel Programming 1 June 9th 05 02:43 AM
Excel automation and Shared Workbooks VadimT Excel Programming 2 March 9th 05 03:30 AM
Excel automation and shared workbooks Matthew L. Butcher Excel Programming 0 December 4th 03 02:58 AM


All times are GMT +1. The time now is 07:30 PM.

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

About Us

"It's about Microsoft Excel"