Hi All,
My first post here. In general, I don't want my users to see the excel window at all, only the userform. I have the following code in the module to show my first userform.
Sub Startup()
'Application.Visible = False
'Application.WindowState = xlMinimized
'Windows(ThisWorkbook.Name).Visible = False
Windows(ThisWorkbook.Name).WindowState = xlMinimized
GetPreferences
InitializeVariables
frmStart.Show
'Windows(ThisWorkbook.Name).Visible = True
Windows(ThisWorkbook.Name).WindowState = xlNormal
'Application.Visible = True
'Application.WindowState = xlNormal
'ActiveWorkbook.Close savechanges:=True
'Application.Quit
End Sub
I have two issues:
I dbl-click the .xlsm file in the windows file explorer. Using windowstate=xlminimized has the expected result, with the exception that the userform is placed behind the windows file explorer window. Is there a way to make the userform come to the foreground (without causing excel window to show as well)? Is it better to use one of the other options commented out?
With the userform shown, if I dbl-click to open another excel file in the file-explorer window, the excel file will not open (I assume because the modal form blocks the excel app). A well written application should not block other excel files from being opened and shown. Anyone have a solution that allows the userform to show, but allow other files to open? For full disclosure the app opens and merges two other workbooks but does so in a separate instance of the excel process using (snippet):
Oh..I am trying to have a solution that will work back to 2007-2013 versions. Not supporting 2003.
FName = Application.GetOpenFilename(filefilter:="Excel Files (*.xl*), *.xl*", _
MultiSelect:=True )
' create a hidden instance of xl
' used to open the base and other spreadsheets prevent interrupting the screen
Set xl = CreateObject("Excel.Application")
If IsArray(FName) Then
'Open the Master workbook
' must use .add instead of .open so workbook stays not visible
Set baseWB = xl.Workbooks.Add(baseWBName)
Set BaseWks = baseWB.Worksheets("My Worksheet")
Thanks in advance,
Joe
Bookmarks