Hello everybody,
is it possible to write a function for excel with c-sharp?
I`ve found an interesting atricle which describes such a scenario (the url) but it`s about visual studio 2005. I tried it with visual studio 2010 but it doesn`t work for me.
Can anybody help me please!
Wish you a nice day
Loading
Suthish NairPosted Oct 19, 2010, 4:47 PM
Sorry for posting so many links, here an msdn working sample, try it and let us know.
more
Chr leogPosted Oct 20, 2010, 3:01 PM
@Suthish Nair
Fantastic link. This blog-post worked for me. I`ve looked for that description so long but i didn`t find it.
Thanks very much Mr Suthis Nair, and of course all others too
which you a nice week.
Chr leogPosted Oct 19, 2010, 3:11 AM
For example i want to create my own calculate()-function with c# and on my excel-sheet, i want to write in a cell (eg A1) calculate() ... and it should return the value ...
And the article says ( url), that i should create a class library.
@static library is not a DLL and an add-in must be a DLL.
Yes, I know ;) (it was only to show that i already have a bit knowledge, and i didn`t want to say that a static library is a dll)
Sam HobbsPosted Oct 19, 2010, 2:33 AM
I can't give you an answer because I don't know the question.
By definition of what an add-in is, an add-in cannot be executed by itself. So the question remains: are you sure you need an add-in?
One more thing: a static library is not a DLL and an add-in must be a DLL.
Chr leogPosted Oct 19, 2010, 1:56 AM
that`s correct. I am a windows programming beginner but i programmed a long time with java and so, c# is very easy for me. And that is the cause i want to programme an excel addin in this language (c#) and not vb because i don`t know anything about vb. Still, I`m a Linux-User and not so experienced with MS, I want to learn it.
The article say i should use a Visual C# Class library. And that was the thing i did. I didn`t use an excelAddIn (there are still project-samples for excel but i used the visual c# class library).
And of course, a class libray is either static or dynamic (dll) (references on my c++ knowledge). And i also knew, that i can`t run a class library such as an excecutable. But when i tick the checkbox " Register for COM Interop", i don`t know what`s happening with the library. Can i execute it or not (apparently not :) ...
I would be pleasant if you give me an answer (I know, beginners are exhausting sometimes and they should learn basics first, but this is a thing i want to deal with)
Sam HobbsPosted Oct 18, 2010, 2:56 PM
The problem is likely that you have chosen the wrong sample. You have chosen a sample that creates an Add-In and it sure sounds as if you don't need an Add-In. Have you looked at the articles in this web site?
Krishnendu BanerjeePosted Oct 18, 2010, 12:53 PM
You can use this dll file as adding a reference in any executable project like a windows application and after adding the dll you can use its methods and properties in your executable.
Also you can check articles in the internet on how to use a windows .dll file in C# application.
Chr leogPosted Oct 18, 2010, 8:28 AM
Step 1 say, i should create a class library called ExcelAddin. Ok, the output of this is a dll-file (not an executable). Afterwards, I am following the instructions, copy the c# code nto the class file.
Next point is to run the code. The instructions say, that i should build the ExcelAddin and press F5 (compile). When I press F5, visual studio say that the project can`t start beacause it`s a library, not an executable.
What is the problem here? In the article it says, Build the ExcelAddin and press F5?
Any clues?
Sorry, my os is Windows 7 Professional with .NET Framework 4.0. I`m using Visual Studio 2010
Chr leogPosted Oct 18, 2010, 7:13 AM
I will try it as soon as i can
Sam HobbsPosted Oct 18, 2010, 4:50 AM
Chr leogPosted Oct 18, 2010, 2:13 AM
Sam HobbsPosted Oct 17, 2010, 4:09 PM
Posted Oct 17, 2010, 9:02 AM
http://www.dotnetspider.com/forum/534-Read-Write-excel-file-from-C.aspx
http://social.msdn.microsoft.com/Forums/en/csharplanguage/thread/4b8c7a76-db36-4f53-ab92-0b27faa65521