Macro that duplicates and save file

I In my macro I have to copy the file I’m working on and I have to save it with another name, ie I have to make a duplicate. I can’t find a command to save the file

You may make a nextInterURL from ThisComponent.URL by string functions or in another way and then use

ThisComponent.StoreToURL(nextInterURL, Array())

The original URL of the document (to which the next Save will go) is not changed by SaveToURL StoreToURL. If you want to shift the URL of the open document, use SaveAsURL.

is not changed by SaveToURL

You mean, by StoreToURL()?

Thanks! Will make correction.

I solved with your suggestion, Thanks so much

Do not use the answer option for a comment. Write a comment instead. If the answer is satisfactory, better upvote it and tick as the correct answer (it looks like you have done the latter but not the former).