-
Hello,
Currently i have created an Excel file and it is constantly updating the data. So i need to save the file automatically without constantly prompting me whether i want to overwrite the file or not.. Pls help.
The command i currently used is
"workbooks("c:\temp.xls").save"
-
Code:
Workbooks.Open FileName:="C:\MyFile.xls"
Workbooks.Application.Visible = False
'Update your Data
Workbooks.Application.ActiveWorkbook.Save
Workbooks.Application.Quit
Workbooks.Application.DisplayAlerts = False
Hope this helps!
-
Hi cassandra !!!
example below is for EXCEL VBA.
Code:
Workbooks.Open FileName:="C:\MyFile.xls"
'Update your Data
'turn off warnings
Application.DisplayAlerts = False
'save the activeworkbook
ActiveWorkbook.Save
'turn on warnings
'if another Workbook is not save that we get again a
'saving message
Application.DisplayAlerts = True
Application.Quit
-cu TheOnly
PS: if you need the example in VB pls reply
-
Thanks for replying .. BTW i found out that only when i leave the excel file open then it will constantly prompt me whether i want to overwrite the existing file or not... I have tried with and without the commands it makes no difference so long i don't open the file it will not prompt me anymore.
'Workbooks.Application.Visible = False'
'Workbooks.Application.DisplayAlerts = False'
But the rest of the commands really works.. Thanks again.
-
ActiveWorkbook.Save should not prompt to overwrite though?
provided that the workbook has already been saved...