Thursday, 12 September 2013

Open specific Excel file in new instance of Excel when file is opened

Open specific Excel file in new instance of Excel when file is opened

Info:
I have an Excel file named Demo.xlsm
This file contains a userform named UserForm1 which automatically loads
when the file is opened.
The workbook named Demo.xlsm is also visible in the background behind the
userform when the file is opened.
Problem:
I often have an Excel application already open on my desktop with various
workbooks and worksheets containing information I use on a daily basis. As
it stands, if I go to open the Demo.xlsm file, it will open in the current
Excel application along with all of the other workbook/worksheets I am
using.
First: I would like for the Demo.xlsm file to automatically open in an
entirely separate instance/Excel application than my other works.
Second: I would like for only the userform to be visible. (I have no
need/use for the workbook/worksheets to be visible in the background.)
Third: If its possible to have the 2nd instance of the Excel application
to be minimized while still displaying the userform, that would be
perfect. (Currently, if I attempt to minimize the 2nd instance of the
Excel application, the userform is also minimized)
Private Sub Workbook_Open()
Dim objExcel
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = True
UserForm1.Show
End Sub
I feel that I am not going about this the right way...
Any help with this would be greatly appreciated!

No comments:

Post a Comment