ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Multiple Instance of appliction (https://www.excelbanter.com/excel-discussion-misc-queries/172245-multiple-instance-appliction.html)

Tim Rush

Multiple Instance of appliction
 
I currently have several files in my XLSTART folder that I use all the time.
Normally there is only one instance of EXCEL running. However, I do
periodically have an instance open via automation to run a a couple macros
then close out again. When the second instance opens, it wants to reload all
those files in the XLSTART. Is there a way to prevent this from happening?
When it trys to load them, I get the file in use error dialog boxes asking
for Read/Only or Notify.


Bernie Deitrick

Multiple Instance of appliction
 
Tim,

Try starting the second instance of Excel in safe mode - which uses the /s

You will need to play around with running the command line version, including macro security
settings and furhter automation - but this worked for me:

Sub test()
Dim strProgram As String
Dim TaskID As Double

strProgram = "C:\Program Files\Microsoft Office\Office11\Excel.exe /s ""C:\Copy of Excel\Test
File.xls"""
TaskID = Shell(strProgram, 1)

End Sub

HTH,
Bernie
MS Excel MVP


"Tim Rush" wrote in message
...
I currently have several files in my XLSTART folder that I use all the time.
Normally there is only one instance of EXCEL running. However, I do
periodically have an instance open via automation to run a a couple macros
then close out again. When the second instance opens, it wants to reload all
those files in the XLSTART. Is there a way to prevent this from happening?
When it trys to load them, I get the file in use error dialog boxes asking
for Read/Only or Notify.





All times are GMT +1. The time now is 02:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com