vsto

Why Application.get_Caller(Type.Missing) returns a negative integer?

╄→гoц情女王★ 提交于 2019-12-12 04:43:41
问题 There's something weird about get_Caller(Type.Missing) method. It returns a negative integer, -2146826265 , instead of the Range object as it should. Has anyone come across this issue before? Why is that and how should I solve it? Thanks. Excel.Range range = (Excel.Range) application.get_Caller(System.Type.Missing); The above code would fail if I try to explicitly user type Excel.Range . The error message says, 'Cannot convert type 'int' to 'Microsoft.Office.Interop.Excel.Range'. EDIT: The

VSTO: “Can't find project or library” error occurs on Property Get CallVSTOAssembly

懵懂的女人 提交于 2019-12-12 04:24:33
问题 Using Visual Studio 2008 Excel 2007 workbook customization using VSTO The error "Can't find project or library" recently began occurring in the Excel VBA editor on the following line of code: Property Get CallVSTOAssembly() As ShipdebitClaimProcessor.ThisWorkbook This only happens on clients using the published version. On my development PC it works fine. On the client in the VBE, under Tools, References, it says MISSING: ShipDebitClaimProcessor Location: C:\MyCompany\OfficeApplication\Excel

How do you package a VSTO Word addin for deployment to a 64-bit Windows 10 machine running Microsoft Office 64 bit using WIX?

。_饼干妹妹 提交于 2019-12-12 03:17:32
问题 Problem I can't get 64-bit Word to load (or acknowledge the existence of in any way) an otherwise working Word VSTO add-in . Discussion I have a working Word VSTO add-in that I developed using Visual Studio 2017 on a 64-bit Windows 7 machine running Microsoft Office 32 bit. I use a WIX installer to deploy the add-in. I successfully deployed the add-in to a Windows 7 64 bit "master" gold disk that runs 32-bit Office, i.e., the add-in is available to any user who brings up a virtual desktop

Sort Excel table (ListObject) on protected sheet using Excel Interop

眉间皱痕 提交于 2019-12-12 03:06:37
问题 Sorting Excel tables (ListObjects) is not allowed on protected sheets. You'll see the following error message: I spent weeks looking for a solution with no success. Everything out there is outdated with Excel 2007 code samples. There are no tutorials or guides on how circumvent this limitation. Here's how I was able to finally overcome.. 回答1: There is no trappable event when sorting from the Excel's filter drop-down menu of a table. You can, however, trap the events when an ascending,

Outlook VSTO - Save AppointmentItem Parent

久未见 提交于 2019-12-12 02:54:44
问题 I'm trying to save a appointment series subject. This works as expected but after the save, When I performed move/edit the calendar item, I get this error. Code to reproduce error. public void OnMyButtonClickContext(Office.IRibbonControl control) { var sel = control.Context as Microsoft.Office.Interop.Outlook.Selection; var i = sel[1] as Microsoft.Office.Interop.Outlook.AppointmentItem; i.Parent.Subject = i.Parent.Subject + " [CONFIRMED]"; i.Parent.Save(); } I've tried setting i to null,

Format Entire Excel Column Using C#

匆匆过客 提交于 2019-12-12 02:03:20
问题 I have column F that I want to format as money so add $ sign and commas. It's to late for me to attempt to format it in the Source so I was going to format it via C# after all data has been written to Excel. I know you can use this syntax to change a column to a date - what would be the appropriate syntax for money? range.EntireColumn.NumberFormat = "MM/DD/YYYY"; 回答1: Sorry for my stupidity on this one...it's actually quiet simple range3.EntireColumn.NumberFormat = "$#,##0.00"; 来源: https:/

Cannot ungroup a PowerPoint SmartArt Shape

家住魔仙堡 提交于 2019-12-12 01:58:39
问题 I try to ungroup a SmartArt shape from code, but it always causes an error: "This member can only be accessed for a group". However, it's working, if I right click on the SmartArt shape, and ungroup it. How can I fix this? My code is: public void CreateSmartArt(PowerPoint.Shapes allShapes) { PowerPoint.Shape smartartShape = allShapes.AddSmartArt(IttPowerPoint.Instance.PowerPointApp.SmartArtLayouts["MyLayOut"], 0f, 0f, width, height); Marshal.ReleaseComObject(smartartShape); smartartShape =

How to read the data from Non Adjacent Cells in Excel using C#

馋奶兔 提交于 2019-12-12 01:33:37
问题 I have an excel sheet, in which i have multiple cells selected, which are not adjacent to each other. When the user click on the button, we need to read all the cells data, process it and write it to some other cell. If the cells are adjacent to each other, i was able to get the range and able to perform the operation. But if the cells are not adjacent to each other, i am not able to get the range. The Selection.Range is always giving the address of the last cell we selected. But we need to

mailmerge with visto how to get each record of MailMerge.DataSource.DataFields

好久不见. 提交于 2019-12-12 01:16:42
问题 I' have a Project that needs to do a mailmerge, I'm performing this with VSTO. I need to check if all records on the MailMerge.DataSource.DataFields are ok. i'm doing that with this code. public void verificarPersonas(Word.Document Doc) { ThisAddIn ThisAddIn = Globals.ThisAddIn; List<Personas> miListaPersonas = new List<Personas>(); decimal nRecords = Doc.MailMerge.DataSource.RecordCount; if (nRecords == 0) { cambiarEstado("Empty db or documento does'n prepared for mail merge", false); } else

F# Excel UsedRange is not Defined

巧了我就是萌 提交于 2019-12-12 01:15:51
问题 Error: "The field, constructor or member 'UsedRange' is not defined". Code excerpts: open Microsoft.Office.Interop.Excel open Microsoft.Office.Tools.Excel // Onorio's excellent suggestion didn't fix code until this line was added. // Once the above line was added, Onorio's suggestion worked, // but now F# says "The field, constructor or member 'EntireColumn' is not defined". let xl = ApplicationClass() xl.Workbooks.OpenText(... let wb = xl.Workbooks.Item(1) let ws = wb.ActiveSheet :?>