Hi,
I have a standalone application written in VS .net c# which works on an excel file. But now i want to access that application from excel itself through toolbar or any other way. can anybody help me with how to go about it plz.....
Hi,
I have a standalone application written in VS .net c# which works on an excel file. But now i want to access that application from excel itself through toolbar or any other way. can anybody help me with how to go about it plz.....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ismail khanPosted Apr 9, 2008, 9:17 AM
Thanks for the reply. But it didn't work. It says 'Office' reference was not found. But am still trying that idea.Still hoping it might work.
But there's a doubt. Am i not supposed to do anything in excel to include an option in the taskbar to execute that application in Ms Office Excel??
Bechir BejaouiPosted Apr 7, 2008, 5:44 AM
using Office = Microsoft.Office.Core;
This above line enables you add a CommandBar
Office.CommandBar MyCommandBar;
Then add CommandBarButtons objects
Office.CommandBarButton myCommandButton;
Then Add the commandBar to your given application
MyCommandBar = Application.CommandBars.Add("ProjectName", 1, false, true);
Then add the button into the command bar as follow:
myCommandButton = (Office.CommandBarButton)this.MyCommandBar.Controls.Add(Office.MsoControlType.msoControlButton, Type.Missing, Type.Missing, Type.Missing, true);
Then add an event handler to the click event as bellow
myCommandButton.Click += new Microsoft.Office.Core._CommandBarButtonEvents_ClickEventHandler(cmdAdd_Click);