VBA code to create separate Excel instance and hide application

PatHat

New Member
Joined
Oct 16, 2018
Messages
18
Hi All,

I'm looking for a way to open my workbook in a separate instance of Excel and then hide the application and show only a userform called Client_Information_UF.

After searching around I found this bit of code to create a separate instance of Excel, but if I change xlApp.Visible = True to xlApp.Visible = False, the application and workbook still shows behind the userform when opening. Not sure why, i thought the False statement would hide the application?

Private Sub Workbook_Open()

Dim xlApp As Excel.Application
Set xlApp = New Excel.Application
xlApp.Visible = True
Set xlApp = Nothing
Client_Information_UF.Show

End Sub


I need the application of this particular instance of Excel to hide only. If i was to use for e.g. a shared instance of Excel and use code like Application.Visible = False somewhere in my Sub, then it hides any other workbooks that the user may have open when I open this workbook.

Hope my question is clear and forgive me if its a really obvious solution. I'm really new to VB.

Thanks in advance

Patrick
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Welcome to the forum.

Please take a minute to read the forum rules on cross-posting, then add links here to your posts in other forums. Thanks.
 
Upvote 0
You don't have to. Just add a link to your other thread so that people can see what's already been suggested. You may get additional ideas here. :)
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,213
Members
452,618
Latest member
Tam84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top