Hi all,
need help on how to save a few certain cells in excel sheet to msaccess.
all help needed
regards
Hi all,
need help on how to save a few certain cells in excel sheet to msaccess.
all help needed
regards
Hello
if you want to add records to an existing Access Table , you may try
Sub exportDonnees_Excel_Vers_Access()
'Activate Microsoft ActiveX Data Objects x.x Library
Dim Conn As New ADODB.Connection
Dim rsT As New ADODB.Recordset
Dim maTable As String
maTable = "Table1" ' Table name
With Conn
.Provider = "Microsoft.JET.OLEDB.4.0"
.Open "C:\Documents and Settings\michel\Excel\MaBase_V01.mdb"
End With
With rsT
.ActiveConnection = Conn
.Open maTable, LockType:=adLockOptimistic
End With
With rsT
.AddNew
.Fields(0).Value = Range("A1")
.Fields(1).Value = Range("B1")
.Fields(2).Value = Range("C1")
.Update
End With
rsT.Close
Conn.Close
End Sub
Regards ,
michel
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks