Results 1 to 6 of 6
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im writing code in VBA and want to reference .VB.net code.

    I actually want to use the following .net syntax

    DataList.Sort()
    DataList.Reverse()

    I understand I need to hook into and reference .net however I dont know which reference it is under the Code editor menu
    Tools, References...

    note: ive .NET installed on my pc

    many thanks

    diana

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts
    Diana,

    As far as I know (which is just based on some quick googling), you can't access .NET per se, directly from VBA. You can call a .NET assembly or library from VBA, but you will need Visual Studio to set that up.

    A Google search on "calling .net from vba" will bring up a bunch of references. One example that looks good is this example from CodeProject.com.

    Gary

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Before you dive into the intricacies of using a .NET application from within VBA: could you tell us what is is you are trying to achieve? Chances are very good that your problem has already been addressed.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    im currently coding in VBA
    and I want to use the following .NET syntax

    DataList.Sort()
    DataList.Reverse()



    dd

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Vienna, Wien, Austria
    Posts
    5,009
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Setting up .NET with VBA adds an extra layer of overhead that may not necessarily improve the overall responsiveness of other areas of your code.

    What we are trying to say is that efficient functionality for Sorting & Resorting DataLists already exists in VBA. What is it about the .NET functionality that makes DataList.Sort() & DataList.Reverse() that much more attractive than VBA?
    Gre

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Diana View Post
    im currently coding in VBA
    and I want to use the following .NET syntax

    DataList.Sort()
    DataList.Reverse
    What do you want to sort?
    I'm positive there are much simpler and more efficient ways to do a sort in VBA than by using .NET code.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •