Re: Save an excel file in vbscript without user prompt



At the start of your script, place the line

Const xlSaveChanges = 1

Assuming the workbook object you've created is named objWorkbook and the
application object is named objExcel, finish your script with

objWorkbook.Close xlSaveChanges
objExcel.Quit

Steve


<mattsmith2@xxxxxxxxx> wrote in message
news:1137596511.001119.56270@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi, I am trying to edit an excel spreadsheet and then close it using
> vbscript.
>
> the script currently edits the data fine, but when it closes, it gives
> the Save prompt. Is there a way to close the spreadsheet saving the new
> data automatically without any user input
>
> Thanks
>


.



Relevant Pages

  • Re: excel script
    ... I have never written a script against excel before. ... "Ato Bisda" wrote: ... > The script below will create a new Excel file from any number of multiple workbooks ...
    (microsoft.public.scripting.vbscript)
  • Re: excel script
    ... The script below will create a new Excel file from any number of multiple workbooks ... Const xlSaveChanges = 1 ... Set xlApp = CreateObject ...
    (microsoft.public.scripting.vbscript)