VBA to exit communicator

mtharnden

Board Regular
Joined
Aug 17, 2011
Messages
114
hello helpful people,

i need a VBA line to exit/close communicator.
the computer starts communicator at startup and i have vba doing some other things however the communicator window pops up on top (not logged in) and i need that closed out of. i dont care if it exits out of communicator entirely or just closes the window.


all i can think of but errors ar msgr.close
Code:
Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced 
msgr.close
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
i know how to send an IM so i know i can get excel to see communicator but how can i get it to close the window?

im still playing and trying something with shell, no longer getting errors but it does nothing, cant get it to recognize msgr to quit

Code:
 Dim Shell As Object
    Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced
       
       Set Shell = CreateObject("Shell.Application")
       
       For Each msgr In Shell.Windows
            msgr.Quit
        
    Next
 
Upvote 0
ok i got it working but wanted to post the correct result in case anyone else searches this


Code:
 [COLOR=#000000][FONT=MS Shell Dlg 2]Dim  msgr As CommunicatorAPI.IMessengerWindow
    Set msgr =  CommunicatorAPI.Window
msgr.Close

[/FONT][/COLOR]
 
Upvote 0

Forum statistics

Threads
1,214,967
Messages
6,122,503
Members
449,090
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top