Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro help - 'ExportASCII' attempted before 'RetreiveAll' completes

Status
Not open for further replies.

jwb96

Technical User
Oct 9, 2003
1
US
I have the following code that opens each file in a directory and is supposed to run each query then export it to a csv. This worked previously with Impromptu 6 on NT. We switched to XP and Impromptu 7 and now the queries open and run, but the results are not saved. An error message saying the operation cannont be performed because the server is busy appears. If I cancel the query as soon as it begins, the empty query results are saved. So I know it's not a problem with the file path - it appears the macro is jumping to the export before there is anything to export, and is not waiting for the query to finish. Any help would be welcomed.

Do While thisFile <> &quot;&quot;
count = count+1
ReportFile = sourceDir + thisFile
Set objImpRep = objImpApp.OpenReport (ReportFile)
FName2$ = destDir + left(thisFile, (len(thisFile) - 4)) + &quot;-&quot; + Mid$(Date$,1,3) + Mid$(Date$,4,3) + _
Mid$(Date$,9,2) + &quot;.csv&quot;
objImpRep.RetrieveAll
objImpRep.exportASCII FName2$
objImpRep.CloseReport
thisFile = dir$
Loop
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top