question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`SaveAs` also saves the original.

See original GitHub issue

Description

When I open a document, make changes to some of its elements and later call SaveAs, the original source file also appears to be overwritten.

This happens even when I set AutoSave to false and does not happen prior to disposal.

Expected

My initial assumption was that calling SaveAs would result in the source file never being altered. Similar for example to how a save-as operation in an editor would work. There’s some degree of surprise in the current behaviour.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
twsouthwickcommented, Apr 5, 2023

For v3.0, I’m opting to remove the API as-is since it is the same as clone and has unintuitive behavior (#1376). I’d be happy to reconsider a new behavior for this post v3.0 that doesn’t have the current downfalls

0reactions
twsouthwickcommented, Nov 24, 2022

As @ThomasBarnekow pointed out, this is how it was designed and would indeed take a much deeper architectural change to alter.

I agree, however, that this API is wrongly named. I’m all for suggestions and we can obsolete this one with a warning and provide an API that is better named.

Thoughts of the top of my head:

  • SaveAndCopyTo(...)
  • SaveAndClone(....)
  • CopyTo(…)

Other ideas?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Save a workbook as 'Save As' but Keeping the original ...
i need a code to save my workbook as 'Save As' and close it, while leaving to the original work book open ,I...
Read more >
Save As does not save in original folder
PS seems to be ignoring the "save to original" setting. The path indicated is always the last path used in previous save. Happening...
Read more >
"Save as" vs "Save a copy"
In Word 365, the "Save A Copy" saves the document under a new name, but the original stays open for editing, not the...
Read more >
Excel VBA Save AS but not original file
I know the SaveAs method saves the file and makes the new file saved the active file which is fine. My only question...
Read more >
Save As Keeping Original Open
My solution is to SaveAsCopy as XLSM. Once the copy is saved, I can open the workbook (creating two copies of the workbook...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found