Solved

Making excel always active so a Userform when triggered always appears on top

Posted on 2010-09-03
8
344 Views
Last Modified: 2012-05-10
I have a excel VBA macro that runs on a machine along with several applications. The macro is continuously scanning Atttachamate Extra session for certain conditions and if the condiditions are met the Userform pops up for 30 seconds. The problem I have is that is the excel spreadsheet is not visible on the actual screen the Userform gets hidden when it pops up. Is there any way to ensure that either the excel sheet is always on top of the other applications (i.e activate command at the end of the code) or program the Userform to always be on top of all active applications? This is how I call the userform now  

ALERTForm.Show vbModal
0
Comment
Question by:macrohappy
  • 3
  • 3
  • 2
8 Comments
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
Take a look at this example:

http://xcelfiles.homestead.com/API_10.html

jppinto
0
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
0
 
LVL 33

Expert Comment

by:jppinto
Comment Utility
0
 
LVL 13

Expert Comment

by:MWGainesJR
Comment Utility
Just put this before showing the userform.
Windows("MyExcel.xls").activate
 
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:macrohappy
Comment Utility
MWGainesJR: I did just now add that to the code but the excel spreadsheet itself does not come to the front is that expected? I have not yet tested for the userform as it is a little cumbersome for  the conditions to be met to trigger the parameters
0
 
LVL 13

Expert Comment

by:MWGainesJR
Comment Utility
you mean like sheet1?
Windows("MyExcel.xls").activate
workbooks("MyExcel.xls").sheets("Sheet1").activate
0
 
LVL 13

Accepted Solution

by:
MWGainesJR earned 500 total points
Comment Utility
If you run:
Windows("MyExcel.xls").activate
from VBA Editor, Excel will not cover VBA Editor.  This is expected.   If for example you have two workbooks open "book1" and "Myexcel.xls"
If you create:
Sub activate()
Windows("MyExcel.xls").activate
end sub
in book1 and run Activate() from book1 by choosing it in the macro list (ALT+F8)......myexcel.xls will pop up.....
0
 

Author Closing Comment

by:macrohappy
Comment Utility
Works like a charm..Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now