Solved

VB.NET Access sub or function between projects in a solution

Posted on 2011-03-14
3
289 Views
Last Modified: 2012-05-11
I have a VB.NET 2008 solution that has multiple projects in it.  I need to be able to call a sub that resides in Project A from Project B.  I also need to be able to pass a string to that sub in Project A when I call it from Project B.

Is this possible?  Hopefully it makes sense.  Thanks for the suggestions.
0
Comment
Question by:JasonJasonJasonJason
[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
  • 2
3 Comments
 
LVL 29

Expert Comment

by:Paul Jackson
ID: 35134757
What types of projects are these ?
Usually you would just add a reference to project B from Project A.
Then you would call the sub in thee same way as function but adding the project name and possibly class name infrom of the function/subname i.e.

projectb.classa.suba()

you can obviously pass parameters into this function call in the same way as for a normal function call.
0
 

Author Comment

by:JasonJasonJasonJason
ID: 35134834
i added the reference to the project a from project b.  

In project B when i type projecta.form1. it does not list the subs.

do you know why it would do this?
0
 
LVL 29

Accepted Solution

by:
Paul Jackson earned 500 total points
ID: 35134934
Have a look at this article it should help : http://visualbasic.about.com/od/usingvbnet/l/aa080703a.htm
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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 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