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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Bechir BejaouiRank #144 · 15.9K reputationPosted Apr 7, 2008, 1:44 AM EDT
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);
Ismail khan4 reputationPosted Apr 9, 2008, 5:17 AM EDT
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??