Restricting Opening Workbooks in a Previous Excel Process

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

Guest

Is there a property of the excel application that I can set that would not
allow a user to open another workbook in a previously existing excel process.

This would include, when they double click on a file, using the file open,
and dragging onto the excel window an excel file.

Ideally if they double clicked a file or used the menu, it would open
another excel session.

Regards,
Adam
 
You could use an application event that counts the number of workbooks whenever
one is opened/created and closes it if a certain number is exceeded.

Chip Pearson has lots of information about application events at:
http://www.cpearson.com/excel/AppEvent.htm

Or you could give the user a macro that started up another instance of excel and
opened the workbook there.

Option Explicit
Sub testme02()

Dim xlApp As Excel.Application
Dim myFileName As Variant

myFileName = Application.GetOpenFilename
If myFileName = False Then
Exit Sub
End If

Set xlApp = New Excel.Application
xlApp.Visible = True
xlApp.Workbooks.Open myFileName

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