Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shutting down a form in Excel vba

Status
Not open for further replies.

Jooky68

Programmer
Jul 10, 2002
231
US
I am writing a program in excel vba. What i want to do is run a form through some coding in a module and than automatically run a button on that form, and than continue with the coding in the module. The problem I am encountering is that the only way to continue with the coding in the module is to unload the form in the forms coding. Whenever i try to unload the form though i get an error in the module saying run-time error 91 object variable or with block variable not set
Why am i getting this error and is there a way around it?

dimset.show
gadata.show

i show dimset and automatically run a command button on the form, then i want to continue running the module coding and load gadata. When i try to unload dimset in the forms coding i get an error or the one i stated above at dimset.show. Hiding the dimset form does not make the coding in the module continue with gadata. Does anyone ahve any suggestions??? any help would be greatly appreciated. thanks
 
This sounds like a Modal/Non-Modal issue. I'm no expert, but the coding you're useing will basically pass all macro action to the dimset form. Until that form is closed, the code will not continue.

You may want to try this:

dimset.show,1
gadata.show,1

This will make them non-modal. Alternately, you may want to simply call gadata from the load procedure in dimset.

Hope this is helpful.
 
Calling gadata from the load procedure in dimset will work, but eventually i would have to make it back to the module code. I will never make it back to the module code unless I unload the forms. I will try what you have above...thanks for the response I appreciate it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top