Showing posts with label Form Handle. Show all posts
Showing posts with label Form Handle. Show all posts

Saturday, September 18, 2010

Display a form once Excel executed

This code will let the designed Form to appear in the screen once the Excel file executed.
To set this go to Project Window and double click at ThisWorkbook. Copy below code and change the form name as you want eg. frmReadDir.Show


Private Sub Workbook_Open()
    On Error GoTo error_message
        frmReadDir.Show
    Exit Sub
error_message:
    response = MsgBox("Error " & Err.Number & " " & Err.Description, vbExclamation)
    End
End Sub