hei friends can anyone tell me how to upload excel file to access in vb.....if u give code it will be very much helpfull to me, thankx.

Recommended Answers

All 2 Replies

Ok i will give you code.

How much you are ready to pay me ?

if you mean this: import data from excel spreadsheet to access table then use this

'replace this "c:\temp\filename.xls" with your excel filename.

Private Sub ImportXLSheets()

Dim WrksheetName As String
Dim i As Integer
Dim xl As Object
Set xl = CreateObject("Excel.Application")

xl.Visible = True
xl.Workbooks.Open "c:\temp\filename.xls"

With xl
.Visible = True
With .Workbooks(.Workbooks.Count)
For i = 1 To .Worksheets.Count
WrksheetName = .Worksheets(i).NAME
DoCmd.TransferSpreadsheet (acImport), acSpreadsheetTypeExcel97, WrksheetName, "c:\temp\filename.xls"
Next i
End With

End With
Set xl = Nothing

End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.