Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > Pro VB.NET 2002/2003
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 8th, 2003, 09:39 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
Default Can you write an ActiveX DLL with VB.NET?

Hi,

I need to write an ActiveX DLL for use in an Excel spreadsheet.

Question:

Can I write an ActiveX DLL using "Visual Basic .NET Standard Edition"?

I am new to .NET so am not sure if the new .NET version of VB allows you to write an ActiveX DLL (for use, say, in a VBA application).

If it is possible, please tell me where to start.

Hope you can help.

Thanks.

James


Reply With Quote
  #2 (permalink)  
Old September 8th, 2003, 09:46 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

If you are using Visual Studio.Net, this is pretty simple. View the properties of a .Net project. Go to "Configuration Properties" then "Build". Under "Output Path" there is a checkbox for "Register for COM Interop". This will automatically register the .Net assembly for access from standard COM.

Alternative to this is the "regasm.exe" program that comes with .Net. Just type "regasm" at a command prompt and you should get the command-line help for that exe. This will do the same thing that VS.Net does. After compilation, this registers the .Net DLL with the registry for access from COM.

Peter
Reply With Quote
  #3 (permalink)  
Old September 8th, 2003, 10:32 AM
Authorized User
 
Join Date: Sep 2003
Location: , , .
Posts: 25
Thanks: 0
Thanked 1 Time in 1 Post
Default

Thanks, Peter.

Am I right in thinking that Excel 2002 is a COM-based application? i.e. to write a bespoke class for it (outside of VBA) I must write a COM object (DLL)?

Or... am I making things too difficult - perhaps I can simply write a .NET class that Excel can use.. I don't know, because it is all rather new to me.

Hope you can help.

Many thanks.

James

Reply With Quote
  #4 (permalink)  
Old September 8th, 2003, 11:07 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I think you are misunderstanding things...

If have an application for which you would like to write a COM object you have two options:

1. Write in pre-.Net VB and create an ActiveX COM DLL
2. Write a .Net assembly, and use regasm.exe to register that .Net assembly for use by COM.

The latter gives you the flexibility of writing a much more useful and robust .Net assembly (that runs under the framework) but is accessible to both .Net and COM.

Peter
Reply With Quote
  #5 (permalink)  
Old November 18th, 2006, 01:19 PM
Registered User
 
Join Date: Nov 2006
Location: Lake Elmo, MN, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Did you ever get your excell spreadsheet able to access the .net exe??

I have a similar problem in Access trying to "see" a .net dll. Do you know what to do?

Walt (desperate)

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I build a ActiveX DLL in VS.net 2003 ? Mohammed ASP.NET 1.0 and 1.1 Basics 13 July 13th, 2006 10:47 AM
how to use ActiveX DLL in VB.NET debuajm General .NET 4 June 6th, 2004 05:26 AM
Can you write an ActiveX DLL with VB.NET? james gold VB.NET 1 September 8th, 2003 09:49 AM
Can you write an ActiveX DLL with VB.NET? james gold VB Components 0 September 8th, 2003 09:44 AM
Can you write an ActiveX DLL with VB.NET? james gold VB.NET 2002/2003 Basics 0 September 5th, 2003 05:25 AM



All times are GMT -4. The time now is 08:38 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.