+ Reply to Thread
Results 1 to 5 of 5

Dictionary

Hybrid View

  1. #1
    Jim Cone
    Guest

    Re: Dictionary

    Jac,

    In the VBE, go to Tools | References and checkmark "Microsoft Scripting Runtime"

    Regards,
    Jim Cone
    San Francisco, USA


    "Jac Tremblay" <jac.tremblay@donotspam.com> wrote in message
    news:29B43398-953B-481A-901D-E10503DCB974@microsoft.com...
    > Hi,
    > I want to use the dictionary to store unique values but it only works at the
    > office where they use Excel XP. At home, with Excel 2003, the same code does
    > not work. I get the error "Incorect use of keyword New". There is a reference
    > to Microsoft Scripting Runtime at both places. What could be the problem?
    > Here is the code:
    > ' **********************************************************
    > Option Explicit
    > Private mdctDouble As Dictionary
    > ' **********************************************************
    > Private Sub TestDictionary()
    > Set mdctDouble = New Dictionary
    > MsgBox "Jac is already in the dictionary : " & IsDouble("Jac")
    > MsgBox "Jac is already in the dictionary : " & IsDouble("Jac")
    > Set mdctDouble = Nothing
    > End Sub
    > ' ***********************************************************
    > Private Function IsDouble(ByRef rstrKey As String) As Boolean
    > If mdctDouble.Exists(rstrKey) Then
    > IsDouble = True
    > Else
    > mdctDouble.Add rstrKey, rstrKey
    > IsDouble = False
    > End If
    > End Function
    > ' ***********************************************************
    > Thanks in advance.
    > Jac Tremblay


  2. #2
    Jac Tremblay
    Guest

    Re: Dictionary

    Hi Tim,
    I do have a reference to Microsoft Scripting Runtime at both places. That
    was mentioned in the original post. That is why I suspect some weird
    behaviour from Excel and why I need some explanations or ideas.
    Thank you for your concern.


    "Jim Cone" wrote:

    > Jac,
    >
    > In the VBE, go to Tools | References and checkmark "Microsoft Scripting Runtime"
    >
    > Regards,
    > Jim Cone
    > San Francisco, USA
    >
    >
    > "Jac Tremblay" <jac.tremblay@donotspam.com> wrote in message
    > news:29B43398-953B-481A-901D-E10503DCB974@microsoft.com...
    > > Hi,
    > > I want to use the dictionary to store unique values but it only works at the
    > > office where they use Excel XP. At home, with Excel 2003, the same code does
    > > not work. I get the error "Incorect use of keyword New". There is a reference
    > > to Microsoft Scripting Runtime at both places. What could be the problem?
    > > Here is the code:
    > > ' **********************************************************
    > > Option Explicit
    > > Private mdctDouble As Dictionary
    > > ' **********************************************************
    > > Private Sub TestDictionary()
    > > Set mdctDouble = New Dictionary
    > > MsgBox "Jac is already in the dictionary : " & IsDouble("Jac")
    > > MsgBox "Jac is already in the dictionary : " & IsDouble("Jac")
    > > Set mdctDouble = Nothing
    > > End Sub
    > > ' ***********************************************************
    > > Private Function IsDouble(ByRef rstrKey As String) As Boolean
    > > If mdctDouble.Exists(rstrKey) Then
    > > IsDouble = True
    > > Else
    > > mdctDouble.Add rstrKey, rstrKey
    > > IsDouble = False
    > > End If
    > > End Function
    > > ' ***********************************************************
    > > Thanks in advance.
    > > Jac Tremblay

    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1