i'm having strange problem.
conn.execute "insert tbl " & _ "select * [excel 8.0;hdr=yes;database=" & thisworkbook.fullname & "].[temp$]" when run code in read write, works. when run while file read-only, code crashes , gives me error : "external table not in expected format".
my connection string (ms access db) :
conn.open "provider=microsoft.jet.oledb.4.0;data source=" & dbpath & ";jet oledb:database password=mypass;persist security info=true"
i don't know else say... it's unlike i've ever encountered. it's weird work in read-write , not read-only.
thanks helping.
i have figured out. turns out code uses original state of workbook if workbook read-only (which makes sense).
conn.execute "insert tbl " & _ "select * [excel 8.0;hdr=yes;database=" & thisworkbook.fullname & "].[temp$]" and since using workbook in read-only , making new sheet put temp data in, original state loaded execute didn't contain new sheet wasn't saved.
making new temp workbook , saving it, refering new file, doing insert , deleting afterward seems best solution.
Comments
Post a Comment