Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2006, 01:53 AM
Authorized User
 
Join Date: Apr 2006
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default insert text to active cell by shared add-in

Hi,

I have three question:

1. I built a shared Add-In project that worked good on ms word but i dont know what i have changed, now after many times debugging ms word does not answer to any add-in project at all , I tryed to debugg my code i set "start external program" to Word.exe and used br
eak points but i got message like
"the breakpoint will not currently be hit no symbols have been loaded for this document".

2. how can i insert a text as a custom property to word document?

3. i have built another add-in for Excel it works but i can not insert text to activeCell, I can see my toolbar and my button but it can not insert text.
here is a litle bit of my code:

Excel.Application excelApp = null;

public void OnConnection(object application, Extensibility.ext_ConnectMode c
onnectMode, object addInInst, ref System.Array custom)
{
  excelApp = (Excel.Application)application;
  insertText = MakeANewButton(toolBar, "Insert text", 1044, new _CommandBarB
 uttonEvents_ClickEventHandler(insertText
_Click));
}

private CommandBarButton MakeANewButton(CommandBar commandBar, string captio
n, int faceID, _CommandBarButtonEvents_ClickEventHandle
r clickHandler)
  {
     object missing = System.Reflection.Missing.Value;
     try
     {
        Microsoft.Office.Core.CommandBarButton newButton;
        newButton = (CommandBarButton)commandBar.Controls.Add(MsoContr olType
.msoControlButton, missing, missing, missing, missing);

         newButton.Caption = caption;
         newButton.FaceId = faceID;
         newButton.Click += clickHandler;
         return newButton;
      }
      catch
      {
          return null;
      }
   }


public void insertText_Click(CommandBarButton barButton, ref bool someBool)
{
   if (excelApp != null)
   {
      this.excelApp.ActiveCell.Value2 = "someText";
   }
}







Similar Threads
Thread Thread Starter Forum Replies Last Post
Office Shared Add-In bmains General .NET 1 November 10th, 2008 03:05 AM
Add a button to a cell hewstone999 Access VBA 2 June 4th, 2008 07:23 AM
Using Formula on Active Cell manojkumarsoni Excel VBA 3 August 26th, 2007 08:56 AM
Inserting formula into active cell alisonchase Excel VBA 3 March 3rd, 2005 10:06 AM
Lose cell Text when editing cell in VSFlexGrid 6 bobcratchet VB How-To 0 July 30th, 2004 09:32 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.