Results 1 to 4 of 4
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    call Access function from Excel (2000)

    I'm failing to devise code in Excel VBA that invokes a function in Access.
    I have based the attached example on a situation that works fin when Excel calls Word, to wit, the use of a Scripting Dictionary to communicate values.

    The code fails when I try to call <font color=red>"GetData"</font color=red> using <font color=red>"ACCESSAp.Run strMacroName, dicParameters"</font color=red> as the calling sequence in the Excel code.
    The code succeeds when I try to call <font color=448800>"TESTGetData"</font color=448800> using <font color=448800>"ACCESSAp.Run strMacroName"</font color=448800> as the calling sequence in the Excel code.

    This leads me to believe that I will not be able to communicate data between Excel and Access, but that doesn't make sense to me at all.
    Clearly Scripting.Dictionary is available in Access, as demonstrated by running TESTGetData from within Access; it prompts for and reports on a supplied string.

    I'd appreciate any hints as to how to resolve this. I have had quite a modest success in communicating extensive data between excel & Word using Scripting.Dictionaries.
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: call Access function from Excel (2000)

    The VBA project name of your Access database is GetData and the name of the procedure is also GetData. This causes confusion. You should change one of the names.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: call Access function from Excel (2000)

    >You should change one of the names.
    Speaking of names, I now have seven jars of jam lined up here with your name on them.
    Thanks!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: call Access function from Excel (2000)

    "A jam called HansV" - that doesn't sound as good as "A fish called Wanda".

Posting Permissions

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