excel-addins

Distributing macro as an Add-In to other users

寵の児 提交于 2020-02-24 11:17:47
问题 I am looking for some tips how to resolve a problem with distributing macro to other users in my company. I’ve created a specific workbook which holds a bunch of various types of data such as dates, strings and numbers. Each of the users have to manage the same types of data, so we use this workbook as a template. Data is stored in a columns to which I’ve applied a conditional formatting and data validation to prevent users from inserting wrong values. This Workbook contains few Worksheets

Distributing macro as an Add-In to other users

岁酱吖の 提交于 2020-02-24 11:17:07
问题 I am looking for some tips how to resolve a problem with distributing macro to other users in my company. I’ve created a specific workbook which holds a bunch of various types of data such as dates, strings and numbers. Each of the users have to manage the same types of data, so we use this workbook as a template. Data is stored in a columns to which I’ve applied a conditional formatting and data validation to prevent users from inserting wrong values. This Workbook contains few Worksheets

Iterating unregistered add-ins (.xla)

落花浮王杯 提交于 2020-01-21 01:42:08
问题 I need help in figuring out how to iterate through currently open Excel add-in files (.xla) that have not been registered in Excel using the Tools > Add-ins menu path. more specifically, I am interested in any workbook that doesn't appear in the Add-In dialog, but has ThisWorkbook.IsAddin = True . Demonstrating the issue: Trying to loop through workbooks as follows doesn't get workbooks with .AddIn = True : Dim book As Excel.Workbook For Each book In Application.Workbooks Debug.Print book

Excel Custom Task Pane not showing

放肆的年华 提交于 2020-01-10 19:51:46
问题 I'm showing a custom task pane in an excel VSTO add-in, I'm building it and showing it as thus: var ctrl = new CellTaskPane(); var pane = CustomTaskPanes.Add(ctrl, "Custom Sheet"); pane.DockPosition = Office.MsoCTPDockPosition.msoCTPDockPositionRight; pane.DockPositionRestrict = Office.MsoCTPDockPositionRestrict.msoCTPDockPositionRestrictNoChange; pane.Visible = true; This is being done in the ThisAddin.cs file and it working just fine on my machine, both under a Debug session and with the

In VSTO Addin for Excel how to handle a button click event from active worksheet?

孤街浪徒 提交于 2020-01-07 03:07:00
问题 Currently I am developing an Excel 2010 Addin using VB.NET 2010 with VSTO. The active worksheet has a button, its click event will be handled by its own VBA code. Now I would like to handle the same button click event in Addin without affecting its original VBA function. Is it possible? And how can I achieve this? The pre-requisite of this task is that nothing is allowed to be changed on the Excel Template (including its VBA code). That's why I am trying from the event handling by VB.NET. The

How to convert from System.Drawing.Color to Excel.ColorFormat in C#? Change comment color

五迷三道 提交于 2020-01-04 06:07:48
问题 I'm developing a vsto addin for Excel, and I'm trying to change the color to the comments in Excel. This is the code that I have: Excel.Range activeCell = _application.ActiveCell; activeCell.AddComment("some text")); activeCell.Comment.Shape.Fill.BackColor = Color.Red; The exception I'm getting is: Cannot implicitly convert type 'System.Drawing.Color' to 'Microsoft.Office.Interop.Excel.ColorFormat' I cannot find how to make a conversion between the two formats. 回答1: One option is to use

Add-In Commands Ribbon shows in Excel Online but not in Excel for Windows

半城伤御伤魂 提交于 2020-01-04 05:37:21
问题 I have an Add-In with its own Ribbon that works fine in Excel online but does not show the Ribbon in Excel on Windows [1]. There, it only shows the default task-pane. To make sure it does not have to do with my own manifest, I verified this with the OfficeDev simple Sample manifest [2]. The only two modifications I did to the xml file are replacing 2 instances of Document with Workbook. Also, I have verified this on two computers. Why could that be? [1] Microsoft Excel 2016 MSO (16.0.4266

System.Windows.Forms.Timer not firing

白昼怎懂夜的黑 提交于 2020-01-01 17:00:34
问题 I want to use a System.Windows.Forms.Timer to ensure that an event fires on the UI thread of an excel addin I'm creating. I construct the timer as follows: private System.Windows.Forms.Timer _timer; private void ThisAddIn_Startup(object sender, System.EventArgs e) { Debug.WriteLine("ThisAddIn_Startup:" + Thread.CurrentThread.ManagedThreadId); _timer = new System.Windows.Forms.Timer(); _timer.Tick += new EventHandler(TimerEventHandler); _timer.Interval = 500; } The timer is fired by a COM

How to intercept clicking of a built-in Office Ribbon control

淺唱寂寞╮ 提交于 2019-12-31 01:59:05
问题 I'm wondering if it's possible to detect when a user has clicked the Header/Footer button in Excel so I can show some custom header/footer related ribbon controls on my add-in's tab and hide them when the user is not in header/footer edit mode. Is it possible to hijack this button click somehow? I've seen applications hijack the Excel Save before. I'm looking for similar behavior just with the header/footer button. I'm using C#, Visual Studio 2012 and Excel 2010. I've created my custom ribbon

Excel custom Add-In not loading when instance of Excel is opened by another application

前提是你 提交于 2019-12-25 05:48:04
问题 I have created a custom add-in for Excel and for the most this work fine without any issues. However, we have a 3rd party application where we can select the option to "Open In Excel". This then loads a new instance of Microsoft Excel with a load of data populated from the application, but does not load the custom add-in. If I go in to the add-ins option, I can see that Excel still seems to think that the add-in is enabled but I can see that it is not because the macros are not imported to