G
Guest
I have reviewed the MS knowledgebase fairly extensively and I have looked
over past threads on this topic. It seems I can added a new record to a
spreadsheet with:
Try
Dim str_Conn As String = "provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\Documents and
Settings\Mark\My Documents\Database\Book1.xls;" & _
"Extended Properties=Excel 8.0;"
Dim objConn As New System.Data.OleDb.OleDbConnection(str_Conn)
objConn.Open()
'Add two records to the table.
Dim objCmd As New System.Data.OleDb.OleDbCommand
objCmd.Connection = objConn
objCmd.CommandText = "Insert into [Sheet3$] (FirstName,
LastName)" & _
" values ('Bill', 'Brown')"
objCmd.ExecuteNonQuery()
objConn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
What is the form of the command if I want to put the number 6 in cell C12 of
Sheet3?
over past threads on this topic. It seems I can added a new record to a
spreadsheet with:
Try
Dim str_Conn As String = "provider=Microsoft.Jet.OLEDB.4.0; " & _
"data source=C:\Documents and
Settings\Mark\My Documents\Database\Book1.xls;" & _
"Extended Properties=Excel 8.0;"
Dim objConn As New System.Data.OleDb.OleDbConnection(str_Conn)
objConn.Open()
'Add two records to the table.
Dim objCmd As New System.Data.OleDb.OleDbCommand
objCmd.Connection = objConn
objCmd.CommandText = "Insert into [Sheet3$] (FirstName,
LastName)" & _
" values ('Bill', 'Brown')"
objCmd.ExecuteNonQuery()
objConn.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
What is the form of the command if I want to put the number 6 in cell C12 of
Sheet3?