Questions

How do I get form to close after executiVB script?

+
0 Votes
Locked

How do I get form to close after executiVB script?

ChrisCPbucc
This simple vbscript executes but the form window stays open. I would like it to quit completly after executing. It is run as an EXE file. I am new to this. Any help please?

Private Sub Form_Load()
'******VBScript to open excel spreadsheet, update cell, save then close
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\excelhdrconv\espre2a.xls")
objExcel.Application.DisplayAlerts = False
objExcel.Application.Visible = True 'True
objExcel.Application.Quit
End Sub

Private Sub cmdClose()
Unload Me
End Sub