Hi guys, here we are again (sorry, we are working on our first project and we are running out of time, hehe)
We have a script wich reads and write data in a excel file. When all operations are done, we use this sentences to save and close the file:
The name of the archive is Data.xls
But when the script finishes, a pop up appears saying that "A file Named Resume.XLW already exists in this location. Do you want to Replace It?" And so we must click OK in order to go on with the flow of scripts.
Of course this is not what we want, since the scripts should run at night with no operator pressing OK on that...
Are we closing bad the excel? Any ideas?
thank you SO much for your time.. !!!
I have made this letter longer than usual, only because I have not had the time to make it shorter.
You can also just use the Save method of the Workbook object rather than the Save method of the Excel OLE object. If you save the opened workbook, no dialogs will be displayed when you close Excel. Here is a sample script in VBScript:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Sub ExcelTest
Set ExcelApp = CreateObject("Excel.Application"
PathToFile = "D:\Test.xls"
Set WBook = ExcelApp.Workbooks.Open(PathToFile)
Set Sheet = WBook.Sheets(1)
Sheet.Cells(1, 1) = "new value"
End Sub</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">Atanas