Visual Studio Developer Center >
Visual Studio Forums
>
Visual Studio Tools for Office
>
Setting active menu in Excel
Setting active menu in Excel
- Hi ,
I created an Excel application addin for Office 2007. Addin registers fine and I am able to see separate menu. However, on doing some operation (specifically involving communicating with a web service and download some data) Excel switches out of current menu. I am not doing anything intentionally. The desired behavior is to remain in the active menu.
The question I have is how to switch menu's in Excel using C# programming.
Appreciate any help in this regard.
Thanks,
Shyam
Answers
- Hi Shyam,
Welcome to MSDN forums!
I'm not very sure about the question you ask, the "separate menu/current menu" you mentioned in your post do you mean a Office Ribbon Tab?
If that is what you mean, the answer is not with the Object Model, we could not access any Ribbon control via the Office Object Model, the olny work around is by using SendKey function to simulate user press the Short Cut of the Ribbon.
There are many discussion on the same topic before, you could refer to:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/273e0cd0-8aed-4a3a-8de9-e984208d027c/
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/8717e9fd-ddac-4cf6-8064-3ee6bd778750/
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/9d17ddeb-901a-4574-bc8b-11807d68815f/
Hope this helps you, any further questions please feel free to follow up.
Thanks.
Tim Li
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer byTim LiMSFT, ModeratorFriday, November 06, 2009 3:21 AM
All Replies
- Hi Shyam,
Welcome to MSDN forums!
I'm not very sure about the question you ask, the "separate menu/current menu" you mentioned in your post do you mean a Office Ribbon Tab?
If that is what you mean, the answer is not with the Object Model, we could not access any Ribbon control via the Office Object Model, the olny work around is by using SendKey function to simulate user press the Short Cut of the Ribbon.
There are many discussion on the same topic before, you could refer to:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/273e0cd0-8aed-4a3a-8de9-e984208d027c/
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/8717e9fd-ddac-4cf6-8064-3ee6bd778750/
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/9d17ddeb-901a-4574-bc8b-11807d68815f/
Hope this helps you, any further questions please feel free to follow up.
Thanks.
Tim Li
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.- Marked As Answer byTim LiMSFT, ModeratorFriday, November 06, 2009 3:21 AM
- Hello,
I am writing to check the status of the issue on your side. Could you please let me know if the suggestion works for you or not? If you have any questions or concerns, please feel free to let me know. I will be more than happy to be of assistance.
Tim Li
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


