?
Solved

Creating Excel v5.0 Add-Ins using Delphi v1.0

Posted on 1997-04-01
1
Medium Priority
?
137 Views
Last Modified: 2012-05-04
Unfortunatly all the examples in the developers kit are written only in C, and although I'm sure it can be done in Delphi, I have yet to figure out how.

What I would like is a sample project which allows me to return say the "Square" of a number from excel.

The Excel cell should be something like =OurFunction(2)

This would return a 4 into the cell.  The Delphi project should of course create a library (DLL) that will be called from Excel.  I have a much bigger project to write for Excel but I need a starting point to build on.
0
Comment
Question by:agrilk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
vorlon earned 300 total points
ID: 1335090
Agrilk,
I might have a solution for you but I'm not sure it will be satisfactory. Try this:

1) Create a DLL in Delphi containing whatever functions you need to access form Excel. In this case, a function such as:

function OurFunction(x:integer):integer;
begin
   OurFunction:=x*x;
end;

Place all functions in a seperate unit, and make the project a DLL. (Don't forget the "export" keyword next to the function definitions). If you need help with this let me know.

After you have a DLL, go into Excel, insert a module and add a function that link to the dll functions. Again, in this case:

Declare the Delphi Dll functions:
Declare Function OurFunction Lib "c:\delphi.dll" (ByVal x as integer)

Function GetSquare(x as integer)
   GetSquare=OurFunction(x)
End function

Once this is done, remove any other sheets from this workbook. Go to Tools, and select Make Add-In... This will create an add-in that you normally wanted.

The reason I mentioned that you might not find this acceptable is because you have to create the extra function calls from excel to access the dll. I don't know of a way around this. If you find a way, please let me know.

Good luck.

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question