excel vba - VBA: Run-time error 3220 “Supplied provider is different from the one already in use” -


i error message

run-time error 3220 "supplied provider different 1 in use" 

when try run following command in file have received

datconnection.open (provider=microsoft.jet.oledb.4.0;data source='c:\users\laptop\desktop\excel files test\macros\example 1.xlsx';extended properties='excel 8.0;hdr=yes;imex=1') 

any idea why error , how can change make work?

i don't know if relevant have

windows 7 x64 excel 2013 

adapted first example on connectionstrings.com page kazjaw linked to:

"provider=microsoft.ace.oledb.12.0;data source=""c:\users\laptop\desktop\excel files test\macros\example 1.xlsx""; extended properties=""excel 12.0 xml;hdr=yes;imex=1"";" 

the version using before works older .xls format. data source contains spaces needs surrounded double quotes. double quotes need escaped doubling them up


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -