Good luck. Let us know how it goes.DearAll,
Thanks to all.
I will try, with your suggestions.
Best regards.
Hi,Have a look at the attached files, using the Access db you can import the DataList sheet in the modified Excel file.
Cheers,
Vlad
Sub Import_XLData(ByVal XLFile_FullPath As String)
Dim rs As DAO.Recordset
Dim oXL As Object
Dim oWB As Object
Set rs = CurrentDb.OpenRecordset("PIR_TABLE", dbOpenDynaset)
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Open(XLFile_FullPath)
With oWB.worksheets("ISSUES")
rs.AddNew
rs.Fields("RIP") = .Range("B8").Value ' possibly still type conversion
' ... other fields
rs.Update
rs.Close
End With
oWB.Close SaveChanges:=False
oXL.Quit
Set oWB = Nothing
Set oXL = Nothing
Set rs = Nothing
End Sub
Look at that:
Code:Sub Import_XLData(ByVal XLFile_FullPath As String) Dim rs As DAO.Recordset Dim oXL As Object Dim oWB As Object Set rs = CurrentDb.OpenRecordset("PIR_TABLE", dbOpenDynaset) Set oXL = CreateObject("Excel.Application") Set oWB = oXL.Workbooks.Open(XLFile_FullPath) With oWB.worksheets("ISSUES") rs.AddNew rs.Fields("RIP") = .Range("B8").Value ' possibly still type conversion ' ... other fields rs.Update rs.Close End With oWB.Close SaveChanges:=False oXL.Quit Set oWB = Nothing Set oXL = Nothing Set rs = Nothing End Sub
Eberhard