Onclick Export Query Results from Access to Excel -
i'm trying export of data access db excel spreadsheet. smooth until tried code onclick event form. here code:
docmd.transferspreadsheet acexport, acspreadsheettypeexcel12, "reportquery", "c:\helloworld.xlsx", true
the error getting 'runtime error 3051' microsoft access database engine cannot open or write file ... opened exclusively user or need permission view , write data.
i find hard believe engine doesn't have permission. there setting or missing here?
it seems not have sufficient permissions write root directory of drive c:
. when testing, choose "safe" location (like documents folder) creating or updating files.
btw, you'll have better success if use acspreadsheettypeexcel12xml
instead of acspreadsheettypeexcel12
when creating .xlsx
files.
Comments
Post a Comment