Question Locked

How do I get form to close after executiVB script?

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

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

3 replies

by chriscpbucc

Excellent! thanks, the END statement did the job. Thanks for the additional links. they are quite helpful also.

This discussion is closed to new replies.