Question

Locked

How do I get form to close after executiVB script?

By 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

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Collapse -

hmm what you have looks right

by markp24 In reply to How do I get form to clos ...
Collapse -

Reponse To Answer

by ChrisCPbucc In reply to hmm what you have looks r ...

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

Back to Software Forum
3 total posts (Page 1 of 1)  

Software Forums