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 ...

what you have should work,
maybe try ending like this
-----
End
end sub
----

i searched online and found this
http://forums.devshed.com/visual-basic-programming-52/how-to-exit-a-program-46747.html

http://support.microsoft.com/kb/153463

http://www.andreavb.com/forum/viewtopic_1046.html

hope those help

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)  

Related Discussions

Related Forums