I have a database that is opened by users with different versions of Access. The reference to MS Excel 15.0 shows up after an Office 2013 user has opened it and the database will not open in earlier versions of Access afterwards until I changed the Excel reference back to an earlier version. I have tried to change all references to Excel in the code to be late binding:
This code is just a sample. There are hundreds of references to Excel in the project. That does not seem to make any difference. Is there some way of late binding Excel so that it won't make it change the reference to Excel 15.0 or some workaround to deal with users who have 2007, 2010 and 2013? Any advice is much appreciated.
Code:
Function OpenExcel(strFileName As String) Dim xl As Object Dim WKB As New Excel.Workbook Set xl = CreateObject("Excel.Application") xl.Visible = True Set WKB = xl.Workbooks.Open(strFileName) Set xl = Nothing Set WKB = Nothing End Function
Comment