vsto

PERFORMANCE - looping over cells - suppress “number stored as text” warning in Excel VSTO with C#

≡放荡痞女 提交于 2019-12-24 06:42:03
问题 I am populating a ListObject with data from a database, and am pre-formatting ListColumns which come from VarChar (& similar) as Text before inserting the data. This works well, but some affected cells now are showing the 'Number Stored As Text' error. The answer https://stackoverflow.com/a/21869098/1281429 suppresses the error correctly, but requires looping through all cells (as it is not possible to perform the action on a range). Unfortunately for large ranges this is unacceptably slow .

How to run a background process in response to selection change event in VSTO Office add-in?

给你一囗甜甜゛ 提交于 2019-12-24 02:51:11
问题 I have an VSTO application-level add-in, with my own custom task pane. I'm trying to intercept the SelectionChange event, and display information in my custom task pane that's relevant to the selection. I do know how to do that synchronously. However the process of fetching the information to display is slow, and I don't want to block the application while I fetch the information. Furthermore, the user may change the selection several times, and I want to cancel any in-progress "fetch"

Call COM add-in via VBA in excel

*爱你&永不变心* 提交于 2019-12-24 02:47:06
问题 I have a COM add-in written in VSTO that I want to call using a VBA macro. With the add-in I need to launch it, enter some text (automatically), then run the application. The add-in is all push button, and I can't readily access the code as some of it is encrypted (it is 3rd party). Regrettably the record function doesn't pick up any activity when clicking this add-in, and I've been unable to add it to the references list on the VBA. I've tried several ways of doing this and none have worked

Dealing with large selection ranges in Excel interop [duplicate]

橙三吉。 提交于 2019-12-24 02:44:44
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: OutofMemory Exception Object Array Size I am trying to capture a spreadsheet data in to a 2D array. I am using VSTO. int rc = 1048576; int cc = 1638; string[,] arr = new string[rc, cc]; The last line throws Out of Memory exception. I would like to show message telling the user only 'X' elements can be captured. Checked MSDN and there is a row count limit mentioned of 16,777,216 for the data-table.So a data table

Can we publish a WORD Add-In to the Windows 10 app store?

二次信任 提交于 2019-12-24 02:16:54
问题 The WORD Add-in is developed using VSTO in Visual Studio 2015. It has a custom ribbon with some buttons that perform certain content manipulation of a WORD Document. Can this be converted to a UWP app using, maybe, Desktop App Converter , Desktop Bridge etc. And then publish that converted UWP app to Windows 10 App Store. Note : The converted UWP app does not have to run on all devices - it's ok if it runs only on desktop as a WORD Add-In. 回答1: No it is not possible. Also the office store

C# Excel VSTO - Possible to move a pivottable?

女生的网名这么多〃 提交于 2019-12-24 01:25:43
问题 I am trying to move a PivotTable in VSTO and not succeeding at all. My logic was to find the range of the pivot table, cut it and paste it into a new range where i am sure that no data exists on the worksheet. public static void MovePivotTable(string sheetName, PivotTable pivotTable, int newX, int newY, int width, int height) { try { Worksheet worksheet = GetOrCreateWorksheet(sheetName); Range topLeft = (Range)worksheet.Cells[newX, newY]; Range bottomRight = (Range)worksheet.Cells[newX +

Reason for VS.NET 'current breakpoint will not be hit' warning?

╄→尐↘猪︶ㄣ 提交于 2019-12-24 00:52:55
问题 Trying to debug a controllers action method, and when I attach to process the debug icon goes hollow and says the 'current breakpoint will not be hit' But I am doing a response.write at that point and when the page renders it does output the test text. So that section is indeed being executed, why does debug mode not work? 回答1: Your source code may be different than the version of the corresponding process that you are attaching to. Your other process may also be built in release mode, i.e.,

Creating UDF with VSTO in Excel

╄→гoц情女王★ 提交于 2019-12-23 23:19:18
问题 I know how I can do this for the simple case as details here: http://geekswithblogs.net/Denis/archive/2007/01/03/102623.aspx But what I'm trying to do is when my category is selected in Excel I want to be able to dynamically populate the function list at run-time. As is, it's populated using all public function in the category DLL. Is there some way of hooking into the event that populates this list and telling it what to use? Or maybe injecting some code into the DLL dynamically, in this

Unable to set item datetime (as PT_SYSTIME) using PropertyAccessor in Outlook VSTO

♀尐吖头ヾ 提交于 2019-12-23 23:18:47
问题 Setting a datetime column in Outlook to a c# DateTime value with the following code documentItem.PropertyAccessor.SetProperty( "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/TestDate/0x0000001F", documentItem.PropertyAccessor.LocalTimeToUTC(DateTime.Now)); converts the columnvalue to type PT_APPTIME, which can't be displayed, sorted etc. in an Outlook-Tableview. All my tries to set the value as a PT_SYSTIME (eg. creating my own PROPVARIANT struct, Marshal

Excel Workbook Activate Event Ambiguity for C# VSTO

北城余情 提交于 2019-12-23 21:08:31
问题 Here is the error: Error 2 Cannot assign to 'Activate' because it is a 'method group' Warning 1 Ambiguity between method 'Microsoft.Office.Interop.Excel._Workbook.Activate()' and non-method 'Microsoft.Office.Interop.Excel.WorkbookEvents_Event.Activate'. Using method group. I can use myWorkbook.Deactivate += new Excel.WorkbookEvents_DeactivateEventHandler(ThisWorkbook_Deactivate); because there is no deactivate() method for a workbook. There is a Activate() method, which i DO NOT want to use.