VB Code:
  1. Set objXl = New Excel.Application
  2.     Set objWkb = objXl.Workbooks.Open(Text1.Text)
  3.  
  4.     directory = App.Path & IIf(Right(App.Path, 1) = "\", "", "\")
  5.     fName = Mid$(Text1.Text, InStrRev(Text1.Text, "\") + 1)
  6.     Set fso = New FileSystemObject
  7.  
  8.     objWkb.SaveAs FileName:="" & directory & "" & fso.GetBaseName(fName) & ".xls"
  9.     objWkb.Saved = True
  10.     objWkb.Close
  11.  
  12.     Set objWkb = Nothing
  13.     Set objXl = Nothing
  14.     MsgBox "done"
  15.    
  16.     Set cn = New ADODB.Connection
  17.     With cn
  18.        .Provider = "MSDASQL"
  19.        .ConnectionString = "Driver={Microsoft Excel Driver (*.xls)};" & _
  20.         "DBQ=C:\Documents and Settings\admin\My Documents\Paul\prjReadTxt\Copy of Book1.xls; ReadOnly=True;"
  21.        .Open
  22.     End With

when in cn.Open it occurs this error..