excel-dna

ExcelDNA throwing exception accessing Range.Value2

我们两清 提交于 2019-12-11 15:08:23
问题 I am porting an excel addin (used shimloader) to exceldna, and yeah, I have seen the other SO (and off SO) questions but nothing resolves my question, and I'm hoping there are newer solutions. The code is simple. [ExcelFunction(Name="DoSomething")] string DoSomething() { var xl = ExcelDna.Application; var callerCell = xl.Caller; var row = getRow(excelReference.RowFirst+1, callerCell.WorkSheet) ; } In GetRow(): var row = (Range)worksheet.Rows[row]; var cell = (Range)bracketRow.Columns[4]; When

Loading Google.Apis.dll gives me StackoverflowException

我的未来我决定 提交于 2019-12-11 12:09:51
问题 I'm having trouble with adding the new Google Analytics APIs to an Excel add-in that I'm building using ExcelDna. I've added these Nugets: <package id="Google.Apis" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Analytics.v3" version="1.9.2.1160" targetFramework="net45" /> <package id="Google.Apis.Auth" version="1.9.3" targetFramework="net45" /> <package id="Google.Apis.Core" version="1.9.3" targetFramework="net45" /> If I create a class: public class Foo { public Foo() {

Excel-DNA: F# Error Initialization [Error] Method not registered

℡╲_俬逩灬. 提交于 2019-12-11 01:48:51
问题 As a neophyte F# developer, I am trying to create a simple Excel-DNA function as follows: [<ExcelFunction(Name="ACount", Description="Count items", Category="Misc Functions", IsThreadSafe = true)>] let aCount (range: _[]) (filter: string) = let result = Seq.ofArray range |> Seq.filter (fun x -> x = filter) |> Seq.length result but it generates the following error on loading to Excel 2016 (64-bit): Initialization [Error] Method not registered - unsupported signature, abstract or generic: What

XlCall.Excel(XlCall.xlcCalculateNow) throws a XlCallException when evented from a backgroundworker

☆樱花仙子☆ 提交于 2019-12-10 23:07:29
问题 I have an ExcelFunction that queues up some calculations: [ExcelFunction(...)] public static void QueueCalcs(... takes ranges ...) { var calcRequests = ... builds list of calc request parameters from ranges ... calcRequests.ForEach(QueueCalculation); } public static void QueueCalculation(calcRequestParameters) { var bWorker = new BackgroundWorker(); bWorker.DoWork += bWorkerDoWork; bWorker.RunWorkerCompleted += bWorkerRunWorkerCompleted; bWorker.RunWorkerAsnc(calcRequestParameters); } private

How to check Excel cell format in C# to see if cell value is a date

萝らか妹 提交于 2019-12-10 00:25:16
问题 Good Morning All! I have been developing a project for some time in which users can publish a set of values for a set of dates. e.g. The user would select a Range in Excel which would contain date values, and an equally sized Range which contains values to publish corresponding to these dates. What I need to do (C#) is check the cell formatting of both Ranges to see which one is 'actually' a date, I've been using ExcelDNA and since all dates are returned as doubles, I can technically parse my

How to get ExcelDNA work with R.Net

陌路散爱 提交于 2019-12-07 22:59:54
问题 I am a C# and R beginner trying to run the example http://mockquant.blogspot.com/2011/07/yet-another-way-to-use-r-in-excel-for.html <DnaLibrary RuntimeVersion="v4.0" Name="My First XLL" Language="CS"> <ExternalLibrary Path="R.NET.dll" /> <Reference Name="R.NET" /> <![CDATA[using System; using System.Collections.Generic; using System.Linq; using System.Text; using ExcelDna.Integration; using RDotNet; namespace CSLib { public class CSLib { static REngine rengine = null; static CSLib() { // Set

Calling Application.Calculate breaks formula being edited

本小妞迷上赌 提交于 2019-12-06 13:16:54
问题 I'm working on an add-in that periodically requests a recalculation using the following: ((Excel.Application) xlApp).Calculate() If the user happens to be editing a formula at the time, Excel breaks the users formula when I do this. I expect the action to fail due to user activity, which it does, but not before oddly interrupting whatever formula the user is typing. For example, if the user is in the middle of typing into a cell =SUM(1+2+ , as soon as I run the above line of code, their input

How to check Excel cell format in C# to see if cell value is a date

那年仲夏 提交于 2019-12-04 22:17:21
Good Morning All! I have been developing a project for some time in which users can publish a set of values for a set of dates. e.g. The user would select a Range in Excel which would contain date values, and an equally sized Range which contains values to publish corresponding to these dates. What I need to do (C#) is check the cell formatting of both Ranges to see which one is 'actually' a date, I've been using ExcelDNA and since all dates are returned as doubles, I can technically parse my 'values' to dates, and cause all kinds of problems. If I can get the cell formatting, I can see

Excel ExcelDNA C# / Try to copy Bloomberg BDH() behavior (writing Array after a web request)

风格不统一 提交于 2019-12-03 10:48:24
问题 I want to copy Bloomberg BDH behavior. BDH makes a web request and write an array (but doesn't return an array style). During this web request, the function returns "#N/A Requesting". When the web request finished, the BDH() function writes the array result in the worksheet. For example, in ExcelDNA, I succeed to write in the worksheet with a thread. The result if you use the code below in a DNA file, the result of =WriteArray(2;2) will be Line 1 > #N/A Requesting Data (0,1) Line 2 > (1,0) (1

c#: ExcelDNA display an array in excel

半腔热情 提交于 2019-12-02 12:35:07
问题 I'm creating a plugin for excel, i would like to know how is it possible to create new rows to display a list or array I created a sample function : [ExcelFunction(Description = "Split string", Category = "STRING")] public static object[] StringSplit([ExcelArgument(Name = "TEXT", Description = "text to split")] string text) { return text.Split(' ').ToArray(); } In this example, the function returns an array with the different keywords. but when i use it via excel, it displays only the first