Results 1 to 3 of 3
  1. #1
    GeorgeJ is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Dec 2014
    Posts
    67

    Compiler won't accept "Excel.Application"

    I am trying to practice transferring data between Access 2013 and Excel 2013.

    I have the following code:
    Sub Test04()
    ‘Line below copied from VBA 2007 Programming Bible
    Dim AppExcel As Excel.Application
    End Sub



    Whenever I try to compile it I get an error saying “User defined type not defined”
    What do I need to add to my file to get it to accept this declaration?

    Thanks in advance

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    In VBA editor - Tools>References, add the Excel object library.

  3. #3
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    Alternatively, particularly if you could have users with different Excel versions, use late binding:

    http://support.microsoft.com/kb/245115

    If everybody will have the same version you do, early binding is probably easier and aytee's answer is the way to go.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 09-03-2014, 03:27 AM
  2. Replies: 1
    Last Post: 04-23-2013, 08:35 AM
  3. Replies: 1
    Last Post: 03-14-2013, 12:39 PM
  4. "Stand alone" application
    By Hugo Pinto in forum Access
    Replies: 1
    Last Post: 08-10-2009, 01:13 PM
  5. Replies: 0
    Last Post: 09-25-2008, 12:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums