+ Reply to Thread
Results 1 to 19 of 19

VBA way to activate MS Teams windows every 5 minutes

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    VBA way to activate MS Teams windows every 5 minutes

    Hello,

    it is possible to make VBA code to activate MS Teams window every 5 minutes from Excel?

    Please help,
    Jacek

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA way to activate MS Teams windows every 5 minutes

    probably not. is MS Teams open at the time you want to send the focus to it's window? program windows, those of programs actually open at the time VBA code runs, are referred to in the professional community as handles. the coding standard that is always written to refer to them, which technically are called pointers, looks like this:
    Please Login or Register  to view this content.
    and you'll have to use windows API logistics, because MS Teams more than likely doesn't have a VBA library that you can hook into with excel. MS doesn't care about helping people out like that because the request is so unique. they're not going to waste time doing it if it doesn't satisfy a billion people who are buyers.

    happy thanksgiving to you. all holidays are wonderful. what a break from this world we live in. much needed....

    here's a wonderful, but heavily complex example of calling DLL functions using VBA. these are called API calls:

    https://renenyffenegger.ch/notes/dev.../Win-API/index

    if you COULD do it with VBA alone and a built-in library, other things that are relevant are things called z-index, focusing, and what I already mentioned: handles. Teams has many functions in it, but they are native internally to it only, per the image I took below with my own installation of it:
    Attached Images Attached Images
    Last edited by vba_php; 11-26-2020 at 10:52 AM.

  3. #3
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: VBA way to activate MS Teams windows every 5 minutes

    You can do it using AppActivate but you need to know the actual window caption at the time (which will vary depending on what channel the user is looking at currently). The ActivateMicrosoftApp method hasn't had an enum added for Teams as far as I know, and I can't get Word's Tasks collection to activate Teams as yet.
    Rory

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA way to activate MS Teams windows every 5 minutes

    rorya,

    teams is newer. it doesn't, apparently. it only has enums for the basics:

    https://docs.microsoft.com/en-us/off...lmsapplication

    per:

    https://docs.microsoft.com/en-us/off...temicrosoftapp

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    Ok Guys,

    thank you!
    Rory so AppActivate will not work for now yes it we do not have enum implemented yet?

    And vba_php - thanks and all the vest for you also!
    So API calls can handle it somehow? IT is possible? Sorry i try to understand from your post it is or not

    JAcek

  6. #6
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA way to activate MS Teams windows every 5 minutes

    Quote Originally Posted by jaryszek View Post
    Rory so AppActivate will not work for now yes it we do not have enum implemented yet?
    correct. not in the way he was mentioning.

    Quote Originally Posted by jaryszek View Post
    So API calls can handle it somehow? IT is possible? Sorry i try to understand from your post it is or not
    i've been doing this work for 2 decades. what I said was very complicated. yes you can do it, I'm sure. however, if you don't have heavy programming knowledge, you will probably have to pay a professional to have it done. the concept of API, when making the windows OS talk to any language that's installed, is very complex for non technical people, and most of the code is written in an older fashion (using bits/bytes, hex numbers, binary numbers, etc, etc....)

  7. #7
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    Thank you Guys - eveything is to do vba_php if you have time.
    But i do not have and do not like using windiws Api idea from VBA - i will look after another solution

    Jacek

  8. #8
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA way to activate MS Teams windows every 5 minutes

    Quote Originally Posted by jaryszek View Post
    eveything is to do vba_php if you have time.
    what do you mean?

  9. #9
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    I mean that if i would time i would do this - but getting with tones of documentation is not for me now.
    I had hop that it is easier to achevie

    Jacek

  10. #10
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: VBA way to activate MS Teams windows every 5 minutes

    oh I see. so you are going to attempt it if you have time. well good! good luck to ya.

  11. #11
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    thanks!

    Jacek

  12. #12
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: VBA way to activate MS Teams windows every 5 minutes

    Quote Originally Posted by jaryszek View Post
    Rory so AppActivate will not work for now yes it we do not have enum implemented yet?
    No, AppActivate will work, but you need to know the actual window caption. Application.ActivateMicrosoftApp will not work.

  13. #13
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    thanks Rory,

    yes so i should to loop trough windows handles and find Teams characteristic via API calls.

    Jacek

  14. #14
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: VBA way to activate MS Teams windows every 5 minutes

    If you like. Why do you want to do this? Seems really annoying to me.

  15. #15
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    To be active not away from computer.

    Jacek

  16. #16
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: VBA way to activate MS Teams windows every 5 minutes

    You could try this - it seems to toggle the status for me:

    Please Login or Register  to view this content.
    then use application.ontime to schedule it.

  17. #17
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    o wow you are master Rory!

    thanks
    why Word appliatin is working here?

    Jacek

  18. #18
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,903

    Re: VBA way to activate MS Teams windows every 5 minutes

    Word has a Tasks object for running processes, which Excel doesn't.

  19. #19
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: VBA way to activate MS Teams windows every 5 minutes

    Thank you Rory!

    Jacek

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 1
    Last Post: 10-01-2020, 10:36 PM
  2. What does this line do? Windows(so.[m3].Value).Activate
    By mutzie in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-10-2016, 10:29 AM
  3. [SOLVED] Windows Wildcard Activate
    By Pierce Quality in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-09-2014, 08:21 AM
  4. Windows Activate
    By ReconMan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-25-2011, 03:02 PM
  5. Windows Activate
    By moericus in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-19-2007, 05:59 PM
  6. Windows.activate
    By chrisbarbers in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-11-2006, 09:18 AM
  7. Windows.Activate
    By Steph in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-17-2006, 05:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1