none
creating vb 2003 .net applications that I can reuse in VBA

    Question

  • I have been trying to figure this out for months.

    I bought visual basic .net 2003 standard edition and assumed (like in vb6) I could easily create .dll to reuse in my VBA applications.  I guess that isnt possible.  Do I need to upgrade to .net professional?  or just abandont the hype of .net and go back to what works ... vb6?  I am so confused by all the options and choices .

    Appreciate and feedback.

    Mark

    Saturday, March 18, 2006 3:37 PM

Answers

  • You will have to use a .NET feature called COM interop

    This feature let you create class libraries from .NET that also is available through COM interfaces. They can then be used from VBA, VB6 or other languages that can use COM.

    You can read more about it

    http://msdn.microsoft.com/vbrun/vbfusion/

     

    Saturday, March 18, 2006 9:56 PM
    Moderator

All replies

  • You will have to use a .NET feature called COM interop

    This feature let you create class libraries from .NET that also is available through COM interfaces. They can then be used from VBA, VB6 or other languages that can use COM.

    You can read more about it

    http://msdn.microsoft.com/vbrun/vbfusion/

     

    Saturday, March 18, 2006 9:56 PM
    Moderator
  • You're still in the win32 frame of mind.

    .Net 2005 is very different and is way easier once you understand how.  Express is free until Nov 2006 and it can free you up from some of your 2003 tasks.  I started my .NET journey in 2005 and do not know if 2003 will work this way for your question, but read on, trust me on this.

    Alot if the tasks you had to do in win32 are in easy to use namespaces in .net 2.0.

    When you want reusable things in .NET you have easy options.

    Firstm it depends on the reussable thing.

    1) lines of or function code will be a snippet - here the version you use does matter because vs2005 automates it for you(highight, right-click, save as snippet), Express doesn't.  Snippets are xml based heres the link for doing it in express:

    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vseditor/html/0dcaae11-39cf-4463-9c90-2494321251c2.htm

    *While you're there check out the already done snippet library, there's some cool stuff, there are some libraries of snippets that come with standard vs that can be download.

     

    2) item snippet work in a simular fashion.  When you are in Express working on your project and chose add new item, that's what the item template is. If you have a particular item, like an xml file or form that you want to reuse you'd created a template for it and add it to Express.

    The link: 

    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vssoln/html/a08f02bc-02fd-42e5-bb4d-b24df5b77ff7.htm

    Free snippet library:

    http://msdn.microsoft.com/vstudio/downloads/codesnippets/default.aspx

     

    3) What you want is to create a project template.  You know how when you open Express and choose new project and all those files automatically gets created.  You can do that for your own project.

    The link for more info:

    ms-help://MS.VSExpressCC.v80/MS.NETFramework.v20.en/dv_vssoln/html/141fccaa-d68f-4155-822b-27f35dd94041.htm (you've been here before from the previous link, bookmark it)

    It's to the beginning to get some background, the actual work only takes about a minute on a ready to go project.

    Come back and brag about how easy it was.

    As you become more familar with vs as you have with win32, you'll see how much easier it is to focus on your project over the environment itself to get your project created or running in it.

    In vs 2005, you really only need to do .dll when you are creating something that someone else outside of your project(easily done in vs by choosing the create dll templet and adding your logic) or outside(same as before but with an added external tool called Tlibepx.exe) of you're environment will use.

    You are used to doig more in win32, .net was designed for developers to focus more on their work and what they want it to do rather than spend alot of time on learing how to use the ide and marking the run time work for you're code.

    It's work taking the time to run through the major namespaces to see the kind of library thats there and there are free webcasts that speed up your view of .net vs win32 development.

     

    BTW : If you hurry up you can get a free copy of vs 2005 standard edition.  Signup and complete 3 vs asp.net (take the begin and mobile, btw - these guys are really good at training you, plus some are authors of top aps.net books) related webcasts live or on demand and it'll be shipped free of charge plus with some goodies.  And you'll get a coupon taking $400 of the retail price of the vs 2005 pro edition, is that great or what?  All this so we'll do it the right way from the start or before release.  Also the MSDN and MS e-Learning are the best for learning.  Plus there are tools to download to really make your finished product ".NET BEST PRATICES" compliant(sorry for yelling, but the emphasis is there), one shows you where your code can be improved and how.

    The Link:  http://www.learn2asp.net/Campaign.aspx

    Their Legal Stuff:

    Get your complimentary ASP.NET 2.0 Development Pack.

    Attend three webcasts, either live or on-demand, and you’ll receive*:

    • Microsoft® Visual Studio® 2005 Standard Edition (Not for Resale)
    • Five chapters of Programming ASP.NET 2.0 Core Reference, by Dino Esposito
    • A 30-day hosting account to try out your custom Web applications
    • Microsoft Developer Security DVD with how-tos, white papers, tools, webcasts, and code samples that demonstrate how to write more secure code
    • A 50% discount on a Microsoft Certified Professional Exam so you can add your new skills to your resume
    • A voucher that allows you to buy Visual Studio 2005 Professional Edition with an MSDN® Professional Subscription at renewal pricing (a $400 savings)
    Altogether, this complimentary package has an estimated value of $400.

    Government Customers: Microsoft intends that use of the services and products offered as part of this promotion comply with applicable federal, state, and local government gift and ethics rules. If you are a government employee (including an employee of a public education institution), these services and products may be used for evaluation purposes only, solely for the benefit of your agency or institution, and not for the personal use or benefit of any individual. You should consult with your agency or institution counsel or ethics officer prior to use of these services or products. You may return the products to Microsoft at its expense.

    *Offer good in the United States and Canada only through April 17, 2006, while supplies last. This offer is available only to professionals employed in the area of software or Web development who watch three live or on-demand webcasts as part of the ASP.NET 2.0 Webcast Series. This offer is nontransferable. Microsoft is not responsible for nondelivery of gift due to incorrect postal information provided by respondent. Limit: one per customer. Please allow 6–8 weeks for delivery.

    Saturday, March 18, 2006 11:18 PM
  • jvsonline.com,

    what does this has to do with using .NET from VBA?

    If you have some good ideas to share you can post a comment to the appropiate forum instead.

    Sunday, March 19, 2006 12:00 AM
    Moderator
  • I was answering two different questions for in one place.  Big mistake.

    The other question was about templating in .NET.

    This one, only the part about create a .dll project and using the exporting tool to convert the clr to com applied.

    I do not do late night anymore....

    Monday, May 01, 2006 4:04 PM