VBA function in Access not found when importing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikael3432
    New Member
    • Aug 2010
    • 24

    #1

    VBA function in Access not found when importing

    Hey

    I have no problem importing an access table into excel using VBA in excel.

    But if the access table uses a VBA funtion inside access this function can not be found when I try to import the table.

    Anyway to get around this? Thanks
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    I have personally never had to do this, but it sounds like you need to define the function in VBA within Excel, just as you do in Access. I'd try pasting the function definition into an Excel VBA window, compiling, and then checking to see if the function pops up when you try to use it in a formula in the spreadsheet.

    Pat

    Comment

    • TheSmileyCoder
      Recognized Expert Moderator Top Contributor
      • Dec 2009
      • 2322

      #3
      An access table cannot use a function.

      If I understand you correctly, you wish to call a function you have coded in Access from Excel? Is this during or after your transfer of data from Access to Excel?

      Also is the function you want to call located in a forms module, or in its own module?

      Please post the code of the function here as well.

      Comment

      • mikael3432
        New Member
        • Aug 2010
        • 24

        #4
        Yes, during the transfer of data from access to excel.

        The function is located in its own module.

        I think Ive tried to copy the function into excel VBA, but didnt work. (not found)

        Ill post the code tomorrow. I dont have it here.

        Comment

        • TheSmileyCoder
          Recognized Expert Moderator Top Contributor
          • Dec 2009
          • 2322

          #5
          Im not that into Excel vba programming, but plz note that there are several places in Excel in which to place code. There is the worksheet, the workbook, and excel modules. Im not really sure what the placement of the code means, but you could try the different places.

          Comment

          Working...