[RESOLVED] Help to open a maco/userform without the...
word file?
Any help please?
I have a word file, I want to open up this file, so the "enable macro" screen appears, after this i can get the userform to run straight away, but with that userform a word file opens (i think its the active document). Ive used open document function but i dont want the word file to run aswell.
Is it possible for me to select the word file, maybe bypass the enable macro screen???? so the userform can run without the microsoft word file opening aswell?
actually lol i dont think i can bypass the enable macro screen so forget that 1.
thanks
Re: Help to open a maco/userform without the...
If you sign your documents vba project (macro code section) with a digital certificate you can set your security level to high s it will only trust from your signature tso to speak.
You can not just show a UserForm with out the document. To do this you should use VB 6 or VB.NET etc. ;)
Re: Help to open a maco/userform without the...
you can set the application to visible = false, then only the userform will show, remember you need to have ways to close or show the application when the userform is closed
VB Code:
Private Sub Document_New() ' or open
Application.Visible = False
UserForm1.Show
End Sub
Re: Help to open a maco/userform without the...
Quote:
Originally Posted by westconn1
remember you need to have ways to close or show the application when the userform is closed[/Highlight]
Thaks for the code it works a treat, but i do not understand what you mean by this part. IN the userform i do have a finish button, which basically gives the user the option of closing the userform, and if they select yes then the following code kicks in:
me.unload
Im not sure what your suggesting though, but if you could clarify id appreciate it.
Re: Help to open a maco/userform without the...
oh i understand now, i exit the program from the userform. And when i ran another userform on another project, both of the projects could be seen.
What is the best way around this please? Would i use document close? but how could i relate that to my coding? its pretty obvious the me.unload is not going to work
Re: Help to open a maco/userform without the...
you are only seting the word application to not visible, but it is still open and noone can see it to close it
so during the close process for the userform you need to either make it visible again or close the application
VB Code:
Unload Me
Application.Quit
' or Application.Visible=True
Re: Help to open a maco/userform without the...
thanks alot westconn1, i preferred the first one as the true option opens up the document.
your a great help, cheers :thumb: