We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Sub ExportFromAccess() Dim cn As Object Dim rs As Object Dim strFile As String Dim strCon As String Dim strSQL As String Dim s As String Dim i As Integer, j As Integer ' Access database strFile = "C:\eCap_DB\eCAP_DB.mdb" ' Jet 4 connection string strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strFile & ";" & _ "Extended Properties="";HDR=Yes;"";" ' Late binding, so no reference is needed Set cn = CreateObject("ADODB.Connection") Set rs = CreateObject("ADODB.Recordset") cn.Open strCon strSQL = "SELECT * " _ & "FROM view_eCAP_DATA_EXCEL " _ & "WHERE WBS = '433CA' " ' _ '& "AND WBS = '433HF'" rs.Open strSQL, cn, 3, 3 Worksheets("Sheet1").Cells(1, 1).CopyFromRecordset rs rs.Close Set rs = Nothing cn.Close Set cn = Nothing End Sub
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.