ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save an excel file in vbscript without user prompt (https://www.excelbanter.com/excel-programming/350764-save-excel-file-vbscript-without-user-prompt.html)

[email protected]

Save an excel file in vbscript without user prompt
 
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


Steve Yandl

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


wrote in message
ups.com...
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




[email protected]

Save an excel file in vbscript without user prompt
 
Thanks very much



All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com