?
2010-07-13 20:15:03 UTC
I've try this code but doesn't work
Private Sub Command38_Click()
Dim strExcelFile As String
Dim strWorksheet As String
Dim strDB As String
Dim strTable As String
Dim objDB As String
strExcelFile = "C:\Documents and Settings\admin\Desktop\scanned files\admintracker\Others.xls"
strWorksheet = "WorkSheet1"
strDB = "C:\Documents and Settings\admin\Desktop\scanned files\admintracker\Admintracker.mdb"
strTable = "MyTable"
Set objDB = OpenDatabase(strDB)
If Dir(strExcelFile) <> "" Then Kill strExcelFile
End If
objDB.Execute _
"SELECT * INTO [Excel 8.0;DATABASE=" & strExcelFile & _
"].[" & strWorksheet & "] FROM " & "[" & strTable & "]"
objDB.Close
Set objDB = Nothing
End Sub
My other question is... if I have access installed? Is this code will work with no errors?
Cause I got Error in
Set objDB = OpenDatabase(strDB)
please hep me!