473,408 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Calling .Net DLL functions in Excel 2003

Is it possible to call functions wrapped in a DLL created via VS 2003
(Academic) from within an Excel 2003 Module via VBA (Declare Statement in
Excel VBA)?

I know this works with DLLs wrapped with VB6.0P.

I have looked on MSDN, but have no clue where to start searching.
--
Grumpy Aero Guy


Jun 19 '06 #1
4 5479
"Grumpy Aero Guy" <fb@beerme.org> schrieb:
Is it possible to call functions wrapped in a DLL created via VS 2003
(Academic) from within an Excel 2003 Module via VBA
Yes. Enable the "Register for COM interop" checkbox in the project
properties. Compile the project. Add a COM reference to the interop type
library (TLB) that has been created for the .NET DLL.
(Declare Statement in Excel VBA)?


No, simply add a reference to the type library (not the DLL file).

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jun 19 '06 #2
Thank you... I'll give it a shot (something else to play with ! )

--
Grumpy Aero Guy

"Grumpy Aero Guy" <fb@beerme.org> wrote in message
news:fv*******************@tornado.ohiordc.rr.com. ..
Is it possible to call functions wrapped in a DLL created via VS 2003
(Academic) from within an Excel 2003 Module via VBA (Declare Statement in
Excel VBA)?

I know this works with DLLs wrapped with VB6.0P.

I have looked on MSDN, but have no clue where to start searching.
--
Grumpy Aero Guy

Jun 19 '06 #3
Works GREAT...

I really appreciate your concise and knowledgeable answers.

Now, is the type library "independent", or does the DLL need to be there as
well, once reference is set ... (?)

Enquiring minds want to know :-)

Frank B.

--
Grumpy Aero Guy

"Grumpy Aero Guy" <fb@beerme.org> wrote in message
news:fv*******************@tornado.ohiordc.rr.com. ..
Is it possible to call functions wrapped in a DLL created via VS 2003
(Academic) from within an Excel 2003 Module via VBA (Declare Statement in
Excel VBA)?

I know this works with DLLs wrapped with VB6.0P.

I have looked on MSDN, but have no clue where to start searching.
--
Grumpy Aero Guy

Jun 20 '06 #4
The type library only defines the interface that is contained in the dll

So the answer is you need the Dll ( not necesary is the type library , as
it is only handy for developers who can set a reference to it without
actually installing the app on the dev system )
P.s.

Note that you need to use regasm to register the .Net COM assembly on
target systems ( on your dev machine VS.net takes care of that )
regards

Michel Posseth

"Grumpy Aero Guy" wrote:
Works GREAT...

I really appreciate your concise and knowledgeable answers.

Now, is the type library "independent", or does the DLL need to be there as
well, once reference is set ... (?)

Enquiring minds want to know :-)

Frank B.

--
Grumpy Aero Guy

"Grumpy Aero Guy" <fb@beerme.org> wrote in message
news:fv*******************@tornado.ohiordc.rr.com. ..
Is it possible to call functions wrapped in a DLL created via VS 2003
(Academic) from within an Excel 2003 Module via VBA (Declare Statement in
Excel VBA)?

I know this works with DLLs wrapped with VB6.0P.

I have looked on MSDN, but have no clue where to start searching.
--
Grumpy Aero Guy


Jun 20 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Denis | last post by:
Hello, I am working on a large business application written mostly with VC++ and MFC. What I'm trying to do is accessing my database with the existing functions in my c++ application using XML...
1
by: julian.tklim | last post by:
Hi, Recently, I upgraded to MS Office 2003 SP1. I am running on Windows XP SP2, IE6 SP2. When I tried to open my coporate website which runs on IIS Server, one of the ASP page gave a run time...
3
by: Mark Schaffer | last post by:
Basically, I have two questions: 1. How do you create an .xll file using C# and Visual Studio .NET? 2. How do you make functions callable/visible from Excel (2000 or XP)? I am very new to...
1
by: Mark Jerde | last post by:
Yesterday I posted the message below to microsoft.public.dotnet.languages.vb and microsoft.public.vc.language. The two replies are also posted. I need to write some ISO C++ functions, more...
2
by: cr113 | last post by:
I just upgraded from Office 2000 to Office 2003. My VB.NET Excel macro calls don't work any longer. Here is how I make my Excel macro call from VB.NET: Dim objExcel as Excel.Application ...
9
by: Torben Laursen | last post by:
Hi I have a class that I use in Excel to define some custom functions. The problem that I have is that the class also has some building functions that for some reason is there: ToString...
2
by: paigenoel | last post by:
I was wondering how you can add a function (acos) which exists in MS Excel into MS Access 2003? I need several functions, one of which is ACOS. My formula work well in Excel and now I need to use it...
0
NeoPa
by: NeoPa | last post by:
Many of us have noticed that there are some very useful functions available to you when using Excel, but these same functions are not available, as standard, in Access. A particular issue I had...
2
by: Gilbert Tordeur | last post by:
Hello, My Web application in VB2008 with IIS calls Excel (2003) to create an Excel file xls. I use therefore Microsoft.Office.Interop.Excel, version 11. This application does not use anonymous...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.