Does anyone know why this would produce a 'failure creating file' error?
I'm using a workbook that's save in the same location as the data file in the code.....
Both are saved within a folder in my Desktop folder.....
I'm using a workbook that's save in the same location as the data file in the code.....
Both are saved within a folder in my Desktop folder.....
VBA Code:
Sub Get()
Dim cn As ADODB.Connection
Set cn = New ADODB.Connection
cn.ConnectionString = _
"Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=" & ThisWorkbook.Path & "\data.xlsx;" & _
"Extended Properties='Excel 12.0 Xml;HDR=YES';"
cn.Open
cn.Close
End Sub