Invoke exclusive excel process on opening this file

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

An excel workbook is required to start/use an exclusive Excel.exe process
whenever it is opened.

This is to enable it to use specific tools/options settings which may
conflict with those already in use by other open files that may share an
existing process.

eg. some workbooks will use "Auto calc.", others "Manual calc." options

Any ideas?
 
Hi JB,

Rather than seeking to use a separate instance of Excel, perhaps you could
use the Workbook's Activate and Deactivate events.

In the activate event, read and store the current values of any relevant
Excel level settings and then change these to values appropriate to the
workbook.

In the Workbook's deactivate event, restore the relevant settings to the
stored values.

As a simple example, in the workbook's ThisWorbook module:

Option Explicit
Public CalcMode As Long

'=======================>>
Private Sub Workbook_Activate()

CalcMode = Application.Calculation

Application.Calculation = xlCalculationManual

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

'=======================>
Private Sub Workbook_Deactivate()

Application.Calculation = CalcMode

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top