Results 1 to 6 of 6
  1. #1
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313

    How to Refer to Excel 12.0/14.0 Object Library in Access 2007 and 2010

    I am referencing MS Excel 12.0 and MS Access 12.0 Object Libraries in an Access 2007 Database. When I open this with an Access 2007 version, both references stay as 12.0.



    When I open the database with Access 2010, the Access 12.0 gets changed to Access 14.0 and Excel 12.0 gets changed to Excel 14.0 and everything is still fine.

    However, if I open it in Access 2010, then close it, it appears that the Excel Reference is saved as Excel 14.0. If I then open it in an Access 2007 version, the Access Object Library changes back to Access 12.0 Object Library and is located in C:\Program Files\Microsoft Office\Office12\MSACC.OLB. However, the Excel Object Library remains as Excel 14.0 Object Library, is flagged as MISSING and shows the Location as C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE and, of course, since the User is using Office 2007, can't find it.

    Any suggestions would be appreciated.

    Thanks, Eddie

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Maybe don't set library references and use late binding in code.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313
    After more research I have decided that the only practical way to do this is through Late Binding. Since I only need this in one Subroutine, I added the binding code to that procedure... and it turned out to be quite easy. I also removed the Reference to Excel 12.0 Object Library since my Late Binding eliminated its need. Thanks for the help, Eddie

  4. #4
    tonez90 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2014
    Location
    Australia
    Posts
    18
    Hi As I have not used Late Binding any chance of posting an example using the Excel example above.
    Thanks Tony

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    EddieN1 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    May 2011
    Posts
    313
    Tony,

    Don't know if you still need this or not, but here's what I did. This is in an Access database that manipulates data in an Excel Workbook.

    Dim xl As Object
    Dim Wb As Object
    Dim Ws As Object

    Const xlLeft As Long = 2
    Const xlRight As Long = 4

    Set xl = CreateObject("Excel.Application")

    xl.Workbooks.Open "C:\Temp\FeeSchedModel.xlsx"

    Set Wb = xl.ActiveWorkbook

    Set Ws = Wb.Activesheet

    Ws.Name = "Sheet1"

    etc...

    Hope this helps... Eddie

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

Similar Threads

  1. Replies: 5
    Last Post: 01-07-2016, 12:49 PM
  2. Missing Object library and .dll
    By tmcrouse in forum Forms
    Replies: 1
    Last Post: 06-23-2014, 06:17 PM
  3. 2007 versus 2010 and Dao 3.6 object library
    By Mike Dee in forum Programming
    Replies: 2
    Last Post: 08-27-2013, 03:47 AM
  4. Replies: 1
    Last Post: 06-29-2013, 01:49 AM
  5. Replies: 0
    Last Post: 07-31-2012, 12:25 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