+ Reply to Thread
Results 1 to 9 of 9

VBA to retrieve Skype for Business presence/online status

Hybrid View

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    8

    VBA to retrieve Skype for Business presence/online status

    Hi,

    I'm looking to create a function that checks a user's presence on Skype for Business (e.g. Offline, Away etc). I know this was possible when Skype used to be Lync, using the Microsoft Communicator reference. However, I'm not sure how to do so now, and if there's any way to do it without downloading a SDK.

    Any help is much appreciated.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: VBA to retrieve Skype for Business presence/online status

    The skype com library seems to be installed with skype (for personal anyway - don't have business). I've never used it in anger, but just had a little dabble now, seems very straightforward. You'll need to add a reference to "Skyle4COM 1.0 Type Library" (or that's what it is on my computer anyway):
    Sub test()
    
        Dim s As SKYPE4COMLib.Skype
        Dim currentUser As SKYPE4COMLib.User
        
        Set s = New Skype
        Set currentUser = s.currentUser
        
        Debug.Print "Display Name:", currentUser.Handle
        Debug.Print "Is Online:", currentUser.onlineStatus = olsOnline
        
    
    
    End Sub

  3. #3
    Registered User
    Join Date
    10-05-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA to retrieve Skype for Business presence/online status

    This appears to have been discontinued and unavailable in Skype for Business

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,454

    Re: VBA to retrieve Skype for Business presence/online status

    Maybe have a look here: http://users.skynet.be/fa258239/best.../skype4com.pdf

    Page 22, or thereabouts looks to have information about the profile. Never used it so I don't know how effective it is.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: VBA to retrieve Skype for Business presence/online status

    Trevor, that's what I've used and the OP reckons is discontinued (which it's not - I installed it only last week). But it appears it may not be available in the business edition

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,454

    Re: VBA to retrieve Skype for Business presence/online status

    Hi Kyle

    yes, I've used your example and it does work for the current user ... apart from coming up with a message about using third party apps. Can you block this?

    At the risk of a minor hijack, how would you use it to access the status of a user other than the current user?

    Thanks, Trevor

  7. #7
    Registered User
    Join Date
    10-05-2012
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: VBA to retrieve Skype for Business presence/online status

    Quote Originally Posted by TMS View Post
    Hi Kyle

    yes, I've used your example and it does work for the current user ... apart from coming up with a message about using third party apps. Can you block this?

    At the risk of a minor hijack, how would you use it to access the status of a user other than the current user?

    Thanks, Trevor
    This is more or less what I was looking for to be fair. However, sadly I don't believe this Type Library is installed with Skype for Business

  8. #8
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: VBA to retrieve Skype for Business presence/online status

    I don't think you can block it, it's a security feature - should only need accepting once.

    You can do a couple of things, you can search for users or get a specific user by handle like this:
    Sub test()
    
        Dim s As SKYPE4COMLib.Skype
        Dim user As SKYPE4COMLib.user
        Dim users As SKYPE4COMLib.UserCollection
        
        Set s = New Skype
        
        Set users = s.SearchForUsers("Dave")
        
        For Each user In users
            Debug.Print user.Handle, user.FullName, user.PhoneHome
        Next user
        
            
        Set user = s.user("dave123")
        Debug.Print user.Handle, user.FullName, user.PhoneHome
        
    
    
    End Sub

  9. #9
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,454

    Re: VBA to retrieve Skype for Business presence/online status

    Thanks Kyle,

    came up a couple of times. The second time, I followed the link. Doesn't seem to be happening now.

    And your code example, of course, works just fine

    @masterell: if you've not got the reference libraries, I'm not sure what you can do. Is there a Skype forum where you can ask the question?

    Regards, TMS

+ 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. SLA Status formula taking into account Business Days
    By Chris_Mck in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-27-2015, 06:34 AM
  2. Using Sumifs & EDate to retrieve business model info
    By bbarnett in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-22-2015, 11:54 AM
  3. Replies: 0
    Last Post: 04-12-2015, 06:51 AM
  4. Graduating from desktop to online presence
    By abousetta in forum The Water Cooler
    Replies: 5
    Last Post: 03-22-2013, 12:46 PM
  5. Access 2010 and online presence
    By abousetta in forum Access Tables & Databases
    Replies: 2
    Last Post: 06-09-2012, 12:46 PM
  6. Replies: 4
    Last Post: 04-08-2012, 09:43 PM
  7. Can I import my business banking statement online into excel?
    By one crying in the wilderness in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 10-01-2005, 01:05 PM

Tags for this Thread

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