add-in

How can an Excel Add-In respond to events in any worksheet?

不问归期 提交于 2019-11-26 11:17:26
问题 Our workbooks are server-generated SpreadsheetML , which cannot include any VBA code. Creating native Excel files or Excel 2007 XML files is also not an option, unfortunately. So, I have an Excel Add-In (VBA, not XLL) that each of our users installs to add some extra UDFs, etc. that our workbooks need. This works great, but now I need to have a macro that needs to execute every time the user changes the text in any cell, regardless what workbook they are actively using at the time. So far, I\

Exception from HRESULT: 0x800A03EC Error

 ̄綄美尐妖づ 提交于 2019-11-26 04:48:49
问题 I am getting \"HRESULT: 0x800A03EC\" error when running Excel add-in with following code: Excel.Range rng = ActiveSheet.Cells[x, y] as Excel.Range; string before = rng.Value2; string cleanV = System.Text.RegularExpressions.Regex.Replace(before, @\"\\s+\", \"\"); rng.set_Value(cleanV); When error happens X and Y are set to 1, thus Excel range is not violated. I searched extensively and tried a number of ways of setting the cell value (eg. Cells[x,y], range.set_Value()) but am at loss why this

I don't want my Excel Add-In to return an array (instead I need a UDF to change other cells)

半世苍凉 提交于 2019-11-26 01:00:13
问题 I\'ve created an Excel Add-In, and one of the functions of this Add-In, lets say New_Years currently takes in 2 years and outputs every New Years day between those 2 years as an array in Excel. So New_Years(2000,2002) would return Jan 1st 2000, Jan 1st 2001, and Jan 1st 2002 in the last cell. The problem is that I have to know there are going to be 3 dates in that time, select 3 cells, enter my formula in the top cell, and then hit Ctrl + Shift + Enter to fill out the array. I use XLW version

Choosing between MEF and MAF (System.AddIn)

ぃ、小莉子 提交于 2019-11-25 23:29:28
问题 The Managed Extensibility Framework (MEF) and Managed AddIn Framework (MAF, aka System.AddIn) seem to accomplish very similar tasks. According to this Stack Overflow question, Is MEF a replacement for System.Addin?, you can even use both at the same time. When would you choose to use one vs. the other? Under what circumstances would you choose to use both together? 回答1: I've been evaluating these options and here's the conclusion that I came to. MAF is a true addon framework. You can separate

I don't want my Excel Add-In to return an array (instead I need a UDF to change other cells)

主宰稳场 提交于 2019-11-25 22:22:29
I've created an Excel Add-In, and one of the functions of this Add-In, lets say New_Years currently takes in 2 years and outputs every New Years day between those 2 years as an array in Excel. So New_Years(2000,2002) would return Jan 1st 2000, Jan 1st 2001, and Jan 1st 2002 in the last cell. The problem is that I have to know there are going to be 3 dates in that time, select 3 cells, enter my formula in the top cell, and then hit Ctrl + Shift + Enter to fill out the array. I use XLW version 5 to convert my C++ code to an .xll file. I would really like it if there was some way I could just