How to display a form but hide Excel?

mediaeval
06-06-2008, 05:50 AM
I have an Excel macro which performs calculations which take approx 10 minutes. I have a progress meter contained in a form which tells the user how long the process is taking and when they can expect it to finish. I would like to hide Excel from the user but allow them to see the form. I can only find a method to show them both at the same time. When the macro is called via a button on the spreadsheet, I use Application.WindowState = xlMinimized to hide the form, and then I say frmProgress.Show to display the progress bar. But the application minimises, taking the progress bar with it. I thought there might be an Always-On-Top property associated with the form, but not that I can find. It would be ideal to keep the progress bar in the corner of the monitor screen while the user works on something else.

Any suggestions? I believe sub-classing Excel is a potential solution, but its too complex for my liking.

Timbo
06-06-2008, 07:36 AM
Set the 'Visible' property of the Application object in the Initialize and Terminate events of the form :)

mediaeval
06-06-2008, 09:31 AM
Thanks - worked a treat.

Is there an always-on-top property? 'Twould be most useful...

Cas
06-06-2008, 09:59 AM
I don't think there's a way in native VB, but it's very easy (http://allapi.mentalis.org/apilist/45E478D836DB75F98CB43D9DF388B136.html) with API (no need to go to any subclassing-lengths).

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum