How do I close the main host program

A

Andrew

I understand how to close an open document using VBA, but how do I close
the host program as well?

What I want to do is have the main Excel host close when I close my main
form by clicking the 'X' button. Is this possible?

I also want to have the main program to open in either a minimised state
or be hidden such that only my user form is visible.

In other words, I am trying to use VBA in Excel to create a user
interface that will look and feel like a stand-alone program. I cant
justify the purchase of a version of VB for what is simply an exercise
for my own sake.

Thanks in advance,
Andrew
 
P

Perry

Play around with

Private Sub UserForm_QueryClose _
(Cancel As Integer, CloseMode As Integer)

If Not CloseMode Then Application.Quit
End Sub

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top