How do I get form to close after executiVB script? - TechRepublic
Question
October 14, 2011 at 08:52 AM
chriscpbucc

How do I get form to close after executiVB script?

by chriscpbucc . Updated 14 years, 8 months ago

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

This discussion is locked

All Comments