mierlp Posted December 27, 2012 Share Posted December 27, 2012 Hi, Within my application i have a form which contains a listbox with all tables. The user can select a table he wants to export. When he hits the export button the following code will be executed: // Database if NOT dmArtist.Artist.Active then dmArtist.Artist.Active:=TRUE; // Excel export scExcelExport.DataSet:=dmArtist.Artist; scExcelExport.WorksheetName:='Artiesten'; scExcelExport.HeaderText.text:='Artiesten per ' +DateToStr(Date) ; scExcelExport.ExcelVisible:=false; try scExcelExport.ExportDataset; ExportFile:='Artiesten per ' +FormatDateTime('hhmmss', Time) ; scExcelExport.SaveAs(UniServerModule.FilesFolderPath+ExportFile,ffXLS) finally scExcelExport.Disconnect; // Save export UniSession.SendFile(UniServerModule.FilesFolderPath+ExportFile+'.xls', 'Artiesten.xls'); end; end; I save the file to UniServerModule.FilesFolderPath and every file will be created. Sometimes after 3 or 5 export actions (files are created) i got the followin message : 'Cannot open file C:\Data\Delphi\UniGui\myEventWeb\cache\Artiesten per 133412.xls' The process has no access to the file because it's used by a other proces See attachement...it's in Dutch but the translation is above. I test i local as you can see by the path names. Regards Peter Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.