title: VBA open workbook ignoring "missing library" error?
body: <p>I am currently using the following code to open workbooks and search for particular strings:</p>
  
  <pre><code>    Set workbook = Application.Workbooks.Open(Path)
  
      Set VBProj = workbook.VBProject
      Set oComp = VBProj.VBComponents("Module1")
  
      Set CodeMod = oComp.CodeModule
  
      FindWhat = ToFindStr
  
      With CodeMod
          SL = 1
          EL = .CountOfLines
          SC = 1
          EC = 255
          Found = .Find(target:=FindWhat, StartLine:=SL, StartColumn:=SC, _
              EndLine:=EL, EndColumn:=EC, _
              wholeword:=True, MatchCase:=False, patternsearch:=False)
          Do Until Found = False
              Print #fnum1, "found"
              EL = .CountOfLines
              SC = EC + 1
              EC = 255
              Found = .Find(target:=FindWhat, StartLine:=SL, StartColumn:=SC, _
                  EndLine:=EL, EndColumn:=EC, _
                  wholeword:=True, MatchCase:=False, patternsearch:=False)
          Loop
      End With
  </code></pre>
  
  <p>The problem is there appears to be some compiler errors (missing library) when I open a couple of the spreadsheets. Is there any way I can get around this? I just need to get the CodeMod content to somewhere searchable- but the problem appears to be with opening the workbook.</p>