vsto

Excel Add In's Custom Ribbon Tab Will Not Display

。_饼干妹妹 提交于 2020-01-02 04:37:10
问题 I've created an application level add-in for Excel to automate some tasks. I used the VS2012 template Visual C# > Office > 2010 > Excel 2010 Add-In. Rather than having an action pane open every time Excel does, I've opted to create a custom ribbon tab following these instructions: http://msdn.microsoft.com/en-us/library/vstudio/bb386104.aspx However, when I build my project, the tab does not display. I have verified the add-in is loading, and all of its features function properly, except the

VSTO: Application Focus

柔情痞子 提交于 2020-01-02 03:32:26
问题 Anyone know of a way to see if the Excel window of a VSTO project is active/in focus? I'm looking for an equivalent of System.Windows.Window.IsActive . 回答1: I've been frustrated with this as well. Are you using a dialog in the VSTO app? If so, what I have done is add an event to the closing of a Windows Form/Dialog to activate the Office application as follows (example is with Word, so there may be differences in Excel): //... VSTO Startup Event WindowsForm form = new WindowsForm(); form

VSTO: Application Focus

你说的曾经没有我的故事 提交于 2020-01-02 03:32:07
问题 Anyone know of a way to see if the Excel window of a VSTO project is active/in focus? I'm looking for an equivalent of System.Windows.Window.IsActive . 回答1: I've been frustrated with this as well. Are you using a dialog in the VSTO app? If so, what I have done is add an event to the closing of a Windows Form/Dialog to activate the Office application as follows (example is with Word, so there may be differences in Excel): //... VSTO Startup Event WindowsForm form = new WindowsForm(); form

How to make an excel cell ReadOnly using C#?

余生长醉 提交于 2020-01-02 02:51:34
问题 Range range= (Range)this.workSheet.Cells[1,1]; range.AllowEdit = false; When I set the AllowEdit property to false, a compile error will show: Error: Property or indexer 'Microsoft.Office.Interop.Excel.Range.AllowEdit' cannot be assigned to -- it is read only How can I set the range of cells to be Read Only? When I am using validation for this range I got Some exception on my CellContentChanged Event . Here is the code which is in CellContentChanged: var updater = new Action<StyleColorItem>(

How can I persist data for an Excel Ribbon Addin in Excel

江枫思渺然 提交于 2020-01-01 19:42:49
问题 I have created an Excel ribbon addin which needs to persist user selections between Excel sessions. Using custom XML Parts seems to be the best option for this. However I can't get this to work without getting COMExceptions. The MSDN docs are just not very useful (http://msdn.microsoft.com/en-us/library/bb608612.aspx). Can someone give me an example of making this work in an Excel Ribbon addin? 回答1: There are three different methods I know of: Custom XML parts For an application-level add in,

How can I persist data for an Excel Ribbon Addin in Excel

旧城冷巷雨未停 提交于 2020-01-01 19:41:33
问题 I have created an Excel ribbon addin which needs to persist user selections between Excel sessions. Using custom XML Parts seems to be the best option for this. However I can't get this to work without getting COMExceptions. The MSDN docs are just not very useful (http://msdn.microsoft.com/en-us/library/bb608612.aspx). Can someone give me an example of making this work in an Excel Ribbon addin? 回答1: There are three different methods I know of: Custom XML parts For an application-level add in,

add-in in VSTO - How to get text from Word document using Ribbon with button

馋奶兔 提交于 2020-01-01 10:49:29
问题 How can I do something with text in my word document using button in word add-in? I don't know, how to get text from document after click on the button, because Application is not accessible in Ribbon class. 回答1: The following code should take the text found in the selection: string textFromDoc; textFromDoc = Globals.ThisAddIn.Application.Selection.Text; You can also specify the Range by: textFromDoc = Globals.ThisAddIn.Application.ActiveDocument.Range(0, 20).Text; This will take the first 20

Excel 2013 VSTO Ribbon & Edit Controls

最后都变了- 提交于 2020-01-01 05:34:07
问题 The quick overview is I have an Excel AddIn targeting Excel 2013. The AddIn has a custom RibbonUI that contains a couple of read-only EditBoxes that contain workbook specific values. The same AddIn works fine in Excel 2007 & 2010, with the MDI interface, but with 2013 and its SDI interface. With a simple VSTO AddIn, I've added a simple RibbonUI with an EditBox. For testing purposes, I'm just trying to get the EditBox to reflect the Workbook.Fullname of the window in which it appears. Far as I

OneNote VSTO gone?

好久不见. 提交于 2020-01-01 00:43:13
问题 I want to create a project related to OneNote add-on, however when I check into project templates I did not see a project template for OneNote 2013 Add-on. Is there a way I could develop an add-on for OneNote since Microsoft removed it from VSTO? 回答1: VSTO does not support creating addins for OneNote. You can crate an addin for OneNote in a slightly different way though. You need to implement the IRibbonExtensibility interface as noted here. 回答2: This is very helpful tutorial for anyone

VSTO Tools: Office 2010 to 2013 upgrade

故事扮演 提交于 2019-12-31 13:02:07
问题 I'm working on a VSTO tools project for Excel. I'm now in the process of upgrading my machine. My "old" laptop was running Windows 7 x64 with Office 2010 and Visual Studio 2012. My new machine has Windows 8 x64 with Office 2013 and Visual Studio 2012. When opening my solution on VS2012, in the new machine, it gives me an error loading the project: Cannot create the project because the application associated with this project type is not installed on this computer. You must install the