Link to home
Start Free TrialLog in
Avatar of Asatoma Sadgamaya
Asatoma SadgamayaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

DoCmd.TransferSpreadsheet acExport 10

Hi,

I am trying to transfer data using below query. many columns in the below query have got dates in date format. When I transfer below query, I am getting attached message window. how can I stop this window from popping up? Also, I created a table using below given query (QryReportDetailMkQry) and replace the query name with table name in blow script. The script does not output the dataset into the Reports.xlsx

Public Sub Export()
ilDatCretd = FileDateTime("path"
DoCmd.TransferSpreadsheet acExport, 10, "QryReportDetailQry", "C:\NtRp\Reports\Reports.xlsx", True, "RprtDtl" & "." & Format(FilDatCretd, "ddmmyy hhmm")
End Sub

Thanks
K
Error.jpg
Avatar of Scott McDaniel (EE MVE )
Scott McDaniel (EE MVE )
Flag of United States of America image

You get that error on an EXPORT process? You generally see errors like that on an Import.
ASKER CERTIFIED SOLUTION
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Asatoma Sadgamaya

ASKER

Thanks ScriptAddict,

I like your docmd.setwarnings false. that worked for me. Basically the query i need to transfer has got lots of function on each column because of this function it shows #Error on the query wherever there is no values. but when I transfer this query data set into excel, i can't find any #Error on it. Only problem was vba throws warning message.

Cheers