Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • Last Modified:

Getting VBA program on taskbar

Ok...Another tough one...at least for me...

I have a program with several forms that is used to automate a word document.  I would like to have the forms show up on the windows taskbar (for a variety of reasons) while the program is running, if the form is "visable".

Now, I understand that with a single form program, if I check the block in the properties window ("showintaskbar") that the form will show...but this seems to only work with programs of only one form.

In my case, I have most of my code in a module called "subMain." I start the program with subMain and I use the following code

Sub Main()
Dim oform As Form1
Set oform = New Form1
    oform.Show vbModal
Set oform = Nothing
End Sub


And Form1 starts the show.  But even though I indicate in the properties section to "showintaskbar=true", for all of my forms, I can not get them to display.

Have tried a bit of troubleshooting...placed all my code in Form1 and launched, and managed to get Form1 to show up on the taskbar, but still none of the other, subsequent forms (not to mention errors associated with attempts to access variables.

Is there something I'm missing here to get all my forms on the taskbar.

thanks!

Philip





Philip

0
philipsimmons
Asked:
philipsimmons
  • 2
1 Solution
 
agriggsCommented:
A form that is shown modally cannot be shown in the taskbar.

0
 
philipsimmonsAuthor Commented:
Drat!  Any way around this...Is it possible for some forms to be modal and other not?

thanks man
0
 
agriggsCommented:
The main problem for me when I show forms non-modally is that the Show is non-blocking, i.e.


Form1.Show vbModal

does not return until the form is through, so it's easy to keep track of the instance of form1.


Form1.Show

returns immediately as soon as the form is loaded and shown.  So the code example as you gave above wouldn't work
because you unload the form when the Show returns.

Outside of this problem, you can show all of your forms non-modally.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now