Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "Error saving document"

"Error saving document"

Scheduled Pinned Locked Moved C#
help
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    raesa
    wrote on last edited by
    #1

    Hi, I have a small problem.I generated a pdf file with some temperory name and later i am renaming the file.When i am trying to rename the file using FileSystem.Rename, i get an exception "Error saving document". I don't understand why am i getting this error.I checked if my file is already open, but it was not. Please do let me know if you have any ideas. Thnx in advance.

    M 1 Reply Last reply
    0
    • R raesa

      Hi, I have a small problem.I generated a pdf file with some temperory name and later i am renaming the file.When i am trying to rename the file using FileSystem.Rename, i get an exception "Error saving document". I don't understand why am i getting this error.I checked if my file is already open, but it was not. Please do let me know if you have any ideas. Thnx in advance.

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      If you have touched the file it is possible that you are maintaing a connection to the file and therefore it is in use. Make sure you have destroyed/closed all the objects/methods you used to create the file before renaming.

      Never underestimate the power of human stupidity RAH

      R 1 Reply Last reply
      0
      • M Mycroft Holmes

        If you have touched the file it is possible that you are maintaing a connection to the file and therefore it is in use. Make sure you have destroyed/closed all the objects/methods you used to create the file before renaming.

        Never underestimate the power of human stupidity RAH

        R Offline
        R Offline
        raesa
        wrote on last edited by
        #3

        Firstly, Thnx for the reply. I haven't touched the file and i have destroyed all the objects related to it, yet i get the same error.I just dont get what the problem might be. :(

        N 1 Reply Last reply
        0
        • R raesa

          Firstly, Thnx for the reply. I haven't touched the file and i have destroyed all the objects related to it, yet i get the same error.I just dont get what the problem might be. :(

          N Offline
          N Offline
          Nagy Vilmos
          wrote on last edited by
          #4

          make sure any handles you have to the file system are closed and not just cleared. From memory of you clear a file reference it goes to GC, and the handle can still be 'open' until it is destroyed. That is why you should always explicitly close any file streams.


          Panic, Chaos, Destruction. My work here is done.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups