Dear Experts: I would like to have spreadsheets shared between a 2010 Excel user and a 2016 Excel user. The issue is that when a 2016 Excel user saves a spreadsheet; a 2010 Excel user will not be able to open it and run macros which use Word objects. When the user tries to run one of these macros, the following error comes up: "Can't find project or library"
In the VBE, Tools: References: unchecking the following solves the problem: "MISSING: Microsoft Word 16.0 Object Library" The Question is how can this be unchecked automatically?? (The Attachment contains a code for solving this problem, but when I run that code as a Workbook_open procedure, I get an "error in loading DLL" message.) Thank you so much in advance!! M.P. -- Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ https://www.facebook.com/discussexcel FORUM RULES 1) Use concise, accurate thread titles. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get quick attention or may not be answered. 2) Don't post a question in the thread of another member. 3) Don't post questions regarding breaking or bypassing any security measure. 4) Acknowledge the responses you receive, good or bad. 5) Jobs posting is not allowed. 6) Sharing copyrighted material and their links is not allowed. NOTE : Don't ever post confidential data in a workbook. Forum owners and members are not responsible for any loss. --- You received this message because you are subscribed to the Google Groups "MS EXCEL AND VBA MACROS" group. To unsubscribe from this group and stop receiving emails from it, send an email to excel-macros+unsubscr...@googlegroups.com. To post to this group, send email to excel-macros@googlegroups.com. Visit this group at https://groups.google.com/group/excel-macros. For more options, visit https://groups.google.com/d/optout.
*** In a Standard Module *** Option Explicit Sub References_RemoveMissing() 'Macro purpose: To remove missing references from the VBE Dim theRef As Variant, i As Long On Error Resume Next For i = ThisWorkbook.VBProject.References.Count To 1 Step -1 Set theRef = ThisWorkbook.VBProject.References.Item(i) If theRef.isbroken = True Then ThisWorkbook.VBProject.References.Remove theRef End If Next i If Err <> 0 Then MsgBox "A missing reference has been encountered!" _ & "You will need to remove the reference manually.", _ vbCritical, "Unable To Remove Missing Reference" End If On Error GoTo 0 End Sub *** In the ThisWorkbook Module *** Private Sub Workbook_Open() Call References_RemoveMissing End Sub