Excel choosing an excel file to import into Access

Joined
Jun 30, 2011
Messages
2
Reaction score
0
Hi

I found this code that lets the user enter an excel file and then import into access.
End Sub
'Private Sub Command126_Click()
On Error GoTo Err_Command126_Click
Dim strFile As String
strFile = InputBox("What is the name of the file?")
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel9, "MyTableName", _
"f:\" & strFile & ".xlsx", False, "WorksheetName!A1:S200"

End Sub

MyTableName is my access table.

It bombs at "WorksheetName!A1:S200".
The path name to the f drive is to a memory stick.


JAM
 
Hi ,

Please send me the code for updating data's to database when check box is clicked in the datagrid view
 
Back
Top