My application requires creating a new normal excel workbook. For which I am using these options to save it:
And also implementing the steps mentioned in the manual to save normal Excel files:
XLSPadlock.setOption Option:=“2”, Value:=“0”
XLSPadlock.setOption Option:=“1”, Value:=“1”
and
XLSPadlock.setOption Option:=“2”, Value:=“1”
XLSPadlock.setOption Option:=“1”, Value:=“0”
The application requests a name that the user must provide to save the book and also suggests a default name, it works well with the mentioned options.
But when you want to give the same name to a previously generated file, an error appears.
I have tried to create a routine that deletes files that have the name I provide but it does not work, using the vba kill statement and other options. I also included the usage of application.displayalerts=false
What can I do in order that the user would be able to create new files using names that are already created or how to achive that the application replace an old file for a new one using the same name.