I have created a userform to add data in order to generate a report and multiple users will have access to the file containing the userform.However my problem is that everytime i open the ".xlsm" file there are instances where the excel workbook in the background is visible.Also i'm having problems when the userform initiates.I looked for the solution to this on the internet and got a lot many ideas.However,i still did not get what i was looking for and thus am asking the question.
I have tried the following code;
Private Sub Workbook_Open() Application.ScreenUpdating = False Application.DisplayAlerts = False Application.WindowState = xlMinimized ActiveWindow.WindowState = xlMinimized 'Also tried the following '1 'Application.Visible = False(Have error running the code if i use this. It worked fine in excel 2007 but in 2013 and 2016 and higher versions the code won't work properly.No idea why.) '2 ' With Application (This was basically to hide the visible excel application window behind the userform)` ' .WindowState = xlNormal ' .Height = 500 ' .Width = 300 ' End With 'do stuff (Cells.ClearContents) userform1.show End Sub I also tried creating and running a ".vbs" file but, it seems to avoid only the excel startup splash screen.
Set objExcel = CreateObject("Excel.Application") objExcel.Visible = false Set objWorkbook = objExcel.Workbooks.Open("C:\Users\filepath\filename.xlsm") Following are a few screenshots that might help you understand the problem better.
1: On startup the userform always opens up behind my current window.Is there a way to fix this? 
2: Because of the first problem the user usually tends to click on the excel application icon on the task bar. 
3: Thus making the workbook/worksheet visible in the background like so.I want to avoid this from happening.No matter what i want the user to see only the userform .Is there something i'm doing wrong? 
PS. 1: I also saw that one can put a background image of one's choice to avoid showing the excel worksheet.But since i'm fairly new to vba i really don't know if that would be the best option and haven't tried it yet.I'd prefer tweaking the current code i have (if possible) to get the desired result.
