I have created an excel UserForm which I would like to use as the only visible user interface, i.e. the Workbook not visible (or hidden).
In my Workbook_Open() procedure I set the workbook Windows().Visible
property to False before showing the Userform. The form is displayed correctly but it still shows a blank (no worksheet) Excel window on screen. It appears that the workbook has not been opened as the code behind the userform controls give an error 'Calculation' of object '_Application' failed' at statements like Application.Calculation
.
I presumed Thisworkbook.Activate
would Open the workbook.
I need this to work at Windows level hiding the window from the user, rather than Application so as not to affect other workbooks open at the same time.
'-------------------------
Public Sub Workbook_Open()
Set UIwb = ThisWorkbook
Application.ScreenUpdating = False
UIwb.Activate
UIwb.Windows(1).Visible = False
Application.ScreenUpdating = True
'Show Splash Screen (Form)
SplashScreen.Show vbModeless
' Instantiate a new UI Object
Set PT_UI = New ConfigUI
' Clear Global status flags
RPT_STATUS = NO_DATA
End Sub ' Workbook_Open()
'=========================
Can anyone please suggest how to achieve a windowless user interface with VBA?
Application
's main window. – Mathieu GuindonApplication.Visible = False
it hides all open instances of Excel. – NigelH