Microsoft Excel cannot access the file "-". There are several possible reasons. Windows Server 2008 R2 with Microsoft Office 2010

I have a problem with starting the Excel Application under a particular user (service account).
I try to schedule this C# script through an application X (not Windows Task Scheduler. And this
application will always use a service account to run services on the server). If I run the C# script in
command prompt under the same user, it runs. Under the application X, which uses the exact same
user, to initiate the C# script, it fails to open the Excel application (not sufficient permission?).
This script calls application.Workbooks.Open(<ExcelFileName>,0,false,Type.missing....). At this line
of code, it gives the following error:
Microsoft Excel cannot access the file "...". There are several possible reasons:
-The file name or path does not exist.
-The file is being used by another program.
-The workbook you are trying to save has the same name as a currently open workbook.
I tried all the methods that I found online as follow:
Create directory "C:\Windows\SysWOW64\config\systemprofile\Desktop" (for 64 bit Windows) or "C:\Windows\System32\config\systemprofile\Desktop" (for 32 bit Windows).
Changed the DCOM config for the Microsoft Excel application to include this user for Local/Remote Launch and Access.
Enabled all macros in Excel application and set the Trust Center.
Add the user to have full control on all folders that contain the Excel file.
Under DCOM
config, Microsoft Excel Application, if I modify the Identity tab to check on "This User" and enter the username/password to let Excel always run under that user. Then the application runs perfectly. However, other users can't run the excel application
on their own with the following error: "Cannot use object linking and embedding". If I check "Use the launching user", then Excel can't be launched. No errors in the logs or events anywhere to check.
Yet, still the same error. I think it's permission but I am not sure where and what to do for this to work.
Now, normally, when I run this excel report, I can double-click on the file and it'd automatically run,
save the new parameters into the current file and generate a new excel file (with date attached to the
file name). That means there is a change (save) to the original file.
Environment: Windows Server 2008 R2 and running Microsoft Excel 2010.
I appreciate all your help!

I am wondering if this has anything to do with having the user log into Excel.
In point #5 above: Under DCOM config, Microsoft Excel Application, if I modify the Identity tab to check on "This User" and enter the username/password to let Excel always run under that user. Then the application runs perfectly. However, other
users can't run the excel application on their own with the following error: "Cannot use object linking and embedding". If I check "Use the launching user", then Excel can't be launched. No errors in the logs or events anywhere to check.
Because running with the launching user proposes an user to run the Excel application. However, I do not think there is any where that we can pass in the password for this user to Excel. However, this Excel has all the permissions to Excel application as
well as the folders that have the Excel files.
Please help!
Thank you!

Similar Messages

  • Excel Automation with Interop - Windows Service - Microsoft Excel cannot access the file

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file:
    Unhandled exception Occured : 'Microsoft Excel cannot access the file 'bla.xls'. There are several possible reasons:
    The file name or path does not exist.
    The file is being used by another program.
    The workbook you are trying to save has the same name as a currently open workbook.'.'
    The code snippet used to open the file:
    xlApp = new Application();xlApp.Visible = false;xlApp.UserControl = false;xlApp.Application.ScreenUpdating = false;xlApp.DisplayAlerts = false;xlWorkbook = xlApp.Workbooks.Open( Filename: filePath,  UpdateLinks: 2,  IgnoreReadOnlyRecommended: true, Editable: false);
    The console app and windows service are running on a Win Server 2008 64-bit OS with Excel 2013 32-bit installed. The service is running with a special user account, which has all the right permissions on accessed files and folders. The excel process is also
    started with the same account (I cheched that one). 
    I already tried to do the following, but to no avail:
    Run excel.exe /automation -> worked fine
    Created the folders and also gave full control to the account under which the service is run (even gave full control to Everyone)
    C:\Windows\SysWOW64\config\systemprofile\Desktop
    C:\Windows\System32\config\systemprofile\Desktop
    Configured DCOM
    Excel Application -> Identity -> Specific user account
    Excel Application -> Identity -> Interactive User
    Excel Application -> Security -> Launch permissions -> Everyone full control
    Several combinations of the above
    So I really am stuck with this problem right now. Any input on this is appreciated.

    I have a windows console application, which automates Excel. In our scenario the application gets called from a Windows Service. If the console app is executed directly everything works fine. If the console app is executed through the Win Service, we get
    the following error when trying to open the excel file
    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office
    may exhibit unstable behavior and/or deadlock when Office is run in this environment.
    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side.
    If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution.
    You can read more about that in the
    Considerations for server-side Automation of Office article.

  • I have a new Apple TV which is working fine except that I cannot access .mov files which are in my iTunes Library. How can I get to these? I can run them on my computer and select Apple TV on the screen, but the Apple TV goes to a black screen

    I have a new Apple TV which is working fine except that I cannot access .mov files which are in my iTunes Library. How can I get to these? I can run them on my computer and select Apple TV on the screen, but the Apple TV goes to a black screen

    Mov is a container format, you'd need to look at the codec used by the movie file inside the container to know whether it will work with the Apple TV or not.

  • I cannot log into facebook. I get the following message: 404 Error - Not Found The resource you have requested could not be found on the server. There are many possible reasons for this. Either the file does not exist, there is an error in your request,

    I am not able to go to the facebook site. www.facebook.com is not working. I get the following error message. 404 Error - Not Found
    The resource you have requested could not be found on the server. There are many possible reasons for this. Either the file does not exist, there is an error in your request, or the file is not accessible in the requested directory. Please verify that:
    * You have used the proper case; requests ARE case-sensitive!
    * You have entered the URL correctly. (i.e. proper directory/filename)
    * You used the FULL URL. (i.e. proper file type: .html, .gif , .jpg, etc.)
    * You use a tilde (~) before user directories. (i.e. www.furcen.org/~jurann/ )
    * The user/file still exists on this server.
    I also get redirected to "Busca Google" when typing www.facebook.com in the address bar.
    == URL of affected sites ==
    http://facebook.com; buscagoogle.com

    I have the same problem and it does not have to do with firefox. Do you have any idea how to fix it through?

  • "The process cannot access the file ..." occurs when export crystal report

    We are using a web application developed in VS 2005, .NET 2.0 with the bundled Crystal Reports version 10.2.3600.0 running on a Windows 2003 Standard server with 4GB Ram and Dual CPU's. Periodically we are still receiving the following error in our production environment:
    InnerException:
    The process cannot access the file because it is being used by another process.
       at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext)
       at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options)
       at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)
    This is occuring at the point on the code where the report is being exported to a PDF. Exporting the report to Excel does not appear to cause the error.
                    Stream outStream = report.ExportToStream(ExportFormatType.PortableDocFormat);
                    byte[] charStream = new byte[outStream.Length];
                    outStream.Read(charStream, 0, (int)outStream.Length);
                    if ((charStream != null) && (charStream.Length > 0))
                        HttpContext.Current.Response.ContentType = "application/pdf";
                        HttpContext.Current.Response.OutputStream.Write(charStream, 0, charStream.Length);
                        HttpContext.Current.Response.End();
                report.Close();
                report.Dispose();
                ds.Dispose();
                GC.Collect();
    Closing and disposing of the report and dataset (xsd) are followed by a call for garbage collection. We are unable to produce the error in our development environmennt and have not at this point been unable to pinpoint a problematic report. The development team members do have SP1 installed. The report limit has not been changed from the standard of 75 jobs.  Reviewed the following document, Re: "The process cannot access the file ..." occurs when export crystal report However this applies to VS 2008. Any suggestions to resolve the issue would be greatly appreciated.
    Thanks,
    Joe

    Good morning Joe
    For more details re. loading please see the following resources:
    [Crystal Reports 2008 Component Engine Scalability|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/7025839b-00d4-2b10-33b4-cf0aa9e08412?quicklink=index&overridelayout=true]
    [How Can I Optimize Scalability?|http://msdn.microsoft.com/en-us/library/ms225519.aspx]
    [Choosing the Right Business Objects SDK for Your Needs|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/40bccdfd-88a6-2b10-1da1-c47a54b625a7]
    To answer your questions:
    Is it correct to presume that the physical number of CPU's is not factored into the CPL? So that a Server with 2 or more processors does not increase the 3 concurrent requests? Therefore 2 CPU's would not increase the CPL limit to 6 processes?
    - Server with 2 or more processors does not increase the 3 concurrent requests.
    What would be an alternate solution to this limit be, considering the report requests could increase significantly?
    - Only way around this would be to web farm the solution
    If only only 3 reports can be processed at the same time. If one or more of the reports currently processing is taking longer due to receiving large amounts of data, how does that affect the queue? And what is stored in the queue, data and/or the report? Is this something that could consume memory?
    - The report can take as much time as it needs. The result is that one license will not be released until the report is done. There is no data stored, just a pointer to the report. However queued apps will chew up memory, some times to the point of the server becoming unresponsive
    I have read in the documentation on this site, that the dataset sent to the engine is copied in memory during report construction. So if a large amount of data is requested for a report (as an example 10+ MB) Could enough users requesting reports drive the memory up because memory usage doubled due to the dataset?
    - Absolutely. See [Crystal Reports Guide to ADO.NET|http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/401c4455-a31d-2b10-ae96-fa57af5aec20].
    Understanding the the CR DLL's are loaded on the first report request, do they get released at some point time due to inactivity or garbage collection? How much memory usage could be consumed when they load and stay resident?
    - No they do not. Not as long as the application is running.
    Ludek

  • Crashes when running applications from network share - "Windows cannot access the file for one of the following reasons"

    Hi,
    starting a couple of weeks ago, we get the following error(s) when running applications from a network share. We don't know what causes this, we are not aware of any major changes in our network infrastructure or client/Server configuration. We did upgrade
    a lot of machines to Windows 8, but the issue also occurs on older Win7 computers.
    We figured out a workaround though: The applications run fine when launching from a FQDN share (like
    \\share.domain.Company.com) and only cause problems when running from
    \\share directly. They have worked fine for years without FQDN though.
    Any ideas?
    Error Details (the Kind of error differs greatly):
    # 1 #
    Log Name: Application
    Source: Application Error
    Date: ...
    Event ID: 1005
    Task Category: (100)
    Level: Error
    Keywords: Classic
    User: N/A
    Computer: vmDEV
    Description:
    Windows cannot access the file for one of the following reasons: there is a problem with the network connection, the disk that the file is stored on, or the storage drivers installed on this computer; or the disk is missing. Windows closed the program XYZ
    because of this error.
    Program: XYZ
    File:
    The error value is listed in the Additional Data section.
    User Action
    1. Open the file again. This situation might be a temporary problem that corrects itself when the program runs again.
    2. If the file still cannot be accessed and
    - It is on the network, your network administrator should verify that there is not a problem with the network and that the server can be contacted.
    - It is on a removable disk, for example, a floppy disk or CD-ROM, verify that the disk is fully inserted into the computer.
    3. Check and repair the file system by running CHKDSK. To run CHKDSK, click Start, click Run, type CMD, and then click OK. At the command prompt, type CHKDSK /F, and then press ENTER.
    4. If the problem persists, restore the file from a backup copy.
    5. Determine whether other files on the same disk can be opened. If not, the disk might be damaged. If it is a hard disk, contact your administrator or computer hardware vendor for further assistance.
    Additional data
    Error value: C000020C [ also seen with code C00000C4]
    #2 (German error Messages from now on, we only use German OSes, the above english one is translated based on similar error Messages I found on the web) #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea67c3
    Name des fehlerhaften Moduls: clr.dll, Version: 4.0.30319.34014, Zeitstempel: 0x52e0b784
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x00026549
    ID des fehlerhaften Prozesses: 0x13ac
    Startzeit der fehlerhaften Anwendung: 0x01d055a854d36445
    Pfad der fehlerhaften Anwendung: \\share\application.exe
    Pfad des fehlerhaften Moduls: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
    Berichtskennung: 949ea933-c19b-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    Anwendung: XYZ.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: Ausnahmecode c0000006, Ausnahmeadresse 720B6549
    Stapel:
    # 3 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei SP.Forms.AutoCompleteSelectionBase.OnEnter(System.EventArgs)
       bei System.Windows.Forms.Control.NotifyEnter()
       bei System.Windows.Forms.ContainerControl.UpdateFocusedControl()
    # 4 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.IO.UnmanagedMemoryStream.ReadByte()
       bei System.IO.BinaryReader.ReadByte()
       bei System.IO.BinaryReader.Read7BitEncodedInt()
       bei System.Resources.ResourceReader._LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObjectV2(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.ResourceReader.LoadObject(Int32, System.Resources.ResourceTypeCode ByRef)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean, Boolean)
       bei System.Resources.RuntimeResourceSet.GetObject(System.String, Boolean)
       bei System.Resources.ResourceManager.GetObject(System.String, System.Globalization.CultureInfo, Boolean)
       bei System.Resources.ResourceManager.GetStream(System.String, System.Globalization.CultureInfo)
    # 5 #
    Anwendung: WpfApp.exe
    Frameworkversion: v4.0.30319
    Beschreibung: Der Prozess wurde aufgrund einer unbehandelten Ausnahme beendet.
    Ausnahmeinformationen: System.Runtime.InteropServices.SEHException
    Stapel:
       bei System.Reflection.RuntimeParameterInfo.get_Name()
       bei System.Diagnostics.StackTrace.ToString(TraceFormat)
       bei System.Environment.GetStackTrace(System.Exception, Boolean)
       bei System.Exception.GetStackTrace(Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString(Boolean, Boolean)
       bei System.Exception.ToString()
    # 6 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea834f
    Name des fehlerhaften Moduls: KERNELBASE.dll, Version: 6.3.9600.17278, Zeitstempel: 0x53eeb460
    Ausnahmecode: 0xe0434352
    Fehleroffset: 0x00012f71
    ID des fehlerhaften Prozesses: 0xa68
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb7ec4ed6
    Pfad der fehlerhaften Anwendung: \\share\XYZ.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\KERNELBASE.dll
    Berichtskennung: 010514d0-c190-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:
    # 7 #
    Name der fehlerhaften Anwendung: XYZ.exe, Version: 2015.0.496.5054, Zeitstempel: 0x54ea7a6e
    Name des fehlerhaften Moduls: ntdll.dll, Version: 6.3.9600.17630, Zeitstempel: 0x54b0d74f
    Ausnahmecode: 0xc0000006
    Fehleroffset: 0x0006db27
    ID des fehlerhaften Prozesses: 0x18dc
    Startzeit der fehlerhaften Anwendung: 0x01d0559cb08529c3
    Pfad der fehlerhaften Anwendung: \\share\xyz.exe
    Pfad des fehlerhaften Moduls: C:\WINDOWS\SYSTEM32\ntdll.dll
    Berichtskennung: ef389186-c18f-11e4-bf04-78542e186754
    Vollständiger Name des fehlerhaften Pakets:
    Anwendungs-ID, die relativ zum fehlerhaften Paket ist:

    Hi,
    >>The applications run fine when launching from a FQDN share
    It sounds like a DNS suffix issue. When this issue occurs, please try to ping share on the client, then check if the corresponding IP address is correct. If the IP address is wrong, please adjust your settings of DNS to make sure that the client can resolve
    the share correctly.
    If it's very hard to change the settings of the DNS for some reason, as a work around, we can add the entry into the clients' hosts file.
    Best Regards.
    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Excel cannot open the file 'file.xlsx' because the file format

    Every now and then, when I try opening an Excel file, I get a message saying that "Excel cannot open the file 'file.xlsx' because the file format or the file extension is not valid. Verify that the file has not been corrupted and that the file extension
    matches the format of the file.

    Hi,
    Which Excel version are you using? As far as I know, this issue is caused by malware on the affected machine.There are now two known variants of malware which causes this problem: Win32/Crilock.A and
    Win32/Buma!rts. They have both been identified as a new family of ransomware.
    We'd better clean your machine, run Microsoft Safety Scanner (http://www.microsoft.com/security/scanner/en-us/default.aspx).
    For more detail information, please refer to the following link:
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx
    Regards,
    George Zhao
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Error on load: System.IO.IOException: The process cannot access the file : error in event viewer when users want to view documents from this third party deployed scan solution

    Error on load: System.IO.IOException: The process cannot access the file
    '\\server1\SCANSHARED\.pdf' because it is being used by another process.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
       at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
       at System.IO.File.WriteAllBytes(String path, Byte[] bytes)
       at abc.Scan.Layouts.ICC.Scan.View.Page_Load(Object sender, EventArgs e)
    I faced this  error in event viewer  when users want to view documents from this third party deployed scan solution
    here I have two WFS servers  and they configured with load balancing in F5 .
    when I enable both servers in F5 I receive this error messages in 2nd server,
    when users want to view documents
    adil

    Do you have antiVirus installed on the sharepoint servers?
    These folders may have to be excluded from antivirus scanning when you use file-level antivirus software in SharePoint. If these folders are not excluded, you may see unexpected behavior. For example, you may receive "access denied" error messages when files
    are uploaded.
    Please follow this KB and exclude the folders from Scanning.
    http://support.microsoft.com/kb/952167
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Server 2012 R2 SMB - The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    We are having issues with Server 2012 R2 SMB shares.
    We try to write some changes to a file, but we first create a temporary backup in case the write fails. After the backup is created we write the changes to the file and then we get an error:
    The process cannot access the file '\\server\share\test.txt' because it is being used by another process.
    It looks like the backup process keeps the original file in use.
    The problem doesn't always occur the first time, but almost everytime after 2 or 3 changes. I have provided some code below to reproduce the problem, you can run this in a loop to reproduce.
    The problem is that once the error arises, the file remains 'in use' for a while, so you cannot retry but have to wait at least several minutes. 
    I've already used Process Explorer to analyze, but there are no open file handles. 
    To reproduce the problem: create two Server 2012 R2 machines and run the below code from one server accessing an SMB share on the other server.
    Below is the code I use for testing, if you reproduce the scenario, I'm sure you get the same error.
    We are not looking for an alternative way to solve this, but wonder if this is a bug that needs to be reported?
    Anybody seen this behavior before or know what's causing it?
    The code:
    string file =
    @"\\server\share\test.txt";
    if (File.Exists(file))
    File.Copy(file, file +
    ".bak", true);
    File.WriteAllText(file,
    "Testje",
    Encoding.UTF8);
    The error:
     System.IO.IOException: The process cannot access the file '\\server\share\test.txt' because it is being used by another process.

    Hi,
    There is someone else having the same issue with yours. You could try code in the article below:
    “The process cannot access the file because it is being used by another process”
    http://blogs.msdn.com/b/shawncao/archive/2010/06/04/the-process-cannot-access-the-file-because-it-is-being-used-by-another-process.aspx
    If you wonder the root cause of the issue, the .NET Framework Class Libraries forum can help.
    Best Regards,
    Mandy 
    If you have any feedback on our support, please click
    here .
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • I cant figure out what is wrong i keep getting this an OIEception that says "{"The process cannot access the file because it is being used by another process."}

    I am trying to move a file from a folder to another folder.
    here is my code:
    //storage of the all files
    string[] folderContentNames = Directory.GetFiles(@"C:\Users\Jonah\Desktop\Test Pictures");
    private void historyPictureBox_Click(object sender, EventArgs e)
    destinationFile = @"C:\Users\Jonah\Desktop\Test Test";
    File.Move(folderContentNames[1], destinationFile);
    updateListBoxFileName();
    updateImageBox();
    each time I hit the bolded underlined part I get that error message.
    if you need anything else just ask.
    Thanks in advance,
    Thor Orb

    Hi Thor,
    If you want to move a file from a folder to another folder, I think you could get the sourcePath and TargetPath. The code below shows a simple demo:
    string[] folders = Directory.GetFiles(@"D:\Test\VSC#\01\WindowsFormsApp\WindowsFormsApp\Test");
    string desFile =Path.Combine( @"D:\Test\VSC#\01\WindowsFormsApp\WindowsFormsApp\Test - Copy\"+Path.GetFileName(folders[1]));
    File.Move(folders[1], desFile);
    In addition, the link below might be useful to you:
    # How to: Copy, Delete, and Move Files and Folders (C# Programming Guide)
    >> The process cannot access the file because it is being used by another process
    The message seemed that the file was opened in other process. Did you operate the file with other code?
    I think you could check if the files and the folders were opened, and review your codes if they were used in other places.
    If you have any further questions, please feel free to post in this forum.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. <br/> Click <a
    href="http://support.microsoft.com/common/survey.aspx?showpage=1&scid=sw%3Ben%3B3559&theme=tech"> HERE</a> to participate the survey.
    Ya, Thanks I figured about the path and destation. yes I am using the file in another area, the file is an image jpg and I am displaying it in a picture box. Now I have been doing a little research I see a command called Dispose() and this is suppose to
    release the handle on the image, but I can seem to figure out have to use it correctly.
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Collections;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.IO;
    namespace Scanned_Picture_Ogranizer
    public partial class Form1 : Form
    //storage of the all files
    string[] folderContentNames = Directory.GetFiles(@"C:\Users\Jonah\Desktop\Scan Project Testing\Test Pictures", "*.jpg");
    //List<string> folderContentList = folderContentNames.ToList();
    private List<string> folderContentList = new List<string>();
    Bitmap currentImage;
    Bitmap placeHolder;
    public Form1()
    InitializeComponent();
    convertingArrayToList();
    startUpData();
    string sourceFile = @"C:\Users\Jonah\OneDrive\My Programming Projects\Scanned Picture Organizer Project\Test Pictures";
    string destinationFile = "";
    private void moveButton_Click(object sender, EventArgs e)
    private void startUpData()
    //placeHolder = new Bitmap(folderContentList[0]);
    //currentImage = (Bitmap)placeHolder.Clone();
    // Image loadImage = new Bitmap(pictureClones[0]);
    // currentFilePictureBox.Image = loadImage;
    int numberOfFilesLeft = folderContentNames.Length;
    foreach (string name in folderContentNames)
    fileNamesListBox.Items.Add(name);
    fileNameTextBox.Text = folderContentNames[0];
    numberOfFilesLeftTextBox.Text = numberOfFilesLeft.ToString();
    ///loadImage.Dispose();
    //FileStream currentImage = new FileStream(folderContentList[0], FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
    private void convertingArrayToList()
    foreach (string listName in folderContentNames)
    folderContentList.Add(listName);
    private void selectingImageFromListBox()
    private void updateImageBox()
    Bitmap currentImage = new Bitmap(folderContentList[0]);
    currentFilePictureBox.Image = currentImage;
    currentImage.Dispose();
    private void updateListBoxFileName()
    fileNamesListBox.Items.RemoveAt(0);
    fileNameTextBox.Text = folderContentList[0];
    // numberOfFilesLeftTextBox.Text = numberOfFilesLeft.ToString();
    private void historyPictureBox_Click(object sender, EventArgs e)
    destinationFile = @"C:\Users\Jonah\Desktop\Scan Project Testing\Test Test\";
    File.Move(folderContentList[0], destinationFile + System.IO.Path.GetFileName(folderContentList[0]));
    folderContentList.RemoveAt(0);
    updateImageBox();
    updateListBoxFileName();
    when I first start the program the first picture displays, but when I trigger historyPictureBox_Click(), it does that error again. Another things is that I already looked at that link and it didn't help.
    I just super confused, I would like your help on this.
    Thanks,
    Thor Orb

  • Backup stopped before completing. The process cannot access the file because it is being used by another process

    I am working with a client who is attempting to backup to a NAS device 
    The device is a linksys NSS6000 (Cisco device).
    It’s a dual 1Gbit LAN device that supports CIFS / FTP and NFS transfers. It has only 1Gbit lan connected.
    The device has 4 *  500 gb sata drives in raid 1  attached.
    Cables go from cat 5 to fiber back to cat5. (The NAS  is located at a neighboring office) The switches are 1gbit.
    Server is a win2k8r1 fully up to date.
    When backing up to the NAS device, the following error occurs:
    Running backup of volume Local Disk(D:), copied (86%).
    Running backup of volume Local Disk(D:), copied (90%).
    Running backup of volume Local Disk(D:), copied (94%).
    Running backup of volume Local Disk(D:), copied (98%).
    Backup of volume Local Disk(D:) completed successfully.
    Backup stopped before completing.
    Summary of backup:
    Backup stopped before completing.
    The process cannot access the file because it is being used by another process.
    If we redirect the backup to a folder on a 2008 share, the backup completes successfully.
    Only when backing up to the linksys NSS6000 does the error occur.
    No other backup processes are writing to the NAS device so I can't understand why the process thinks the file is
    being used by another process.
    One thing we did notice that when the backup to the NAS device occurs, throughput is about 150 mbit average
    On the 2008 server shares we successfully backup to, the through put is 500 mbit.  Not sure if that is important, but
    might be worth mentioning.
    The following event log entry was noted at the end of the backup.
    The description for Event ID '519' in Source 'Microsoft-Windows-Backup' cannot be found. 
    The local computer may not have the necessary registry information or message DLL files to display the message,
    or you may not have permission to access them.  The following information is part of the
    event:'2009-05-12T10:13:31.617Z', '', '2147942432', '%%2147942432'
    Any ideas?
    Thanks..Michael

    I am also seeing the same problem backing up nightly to a brand new NAS device (WD My Book Live)
    All the error codes are the same as those in this thread.
    From Windows Event Viewer:
    The backup operation that started at '‎2011‎-‎03‎-‎25T06:00:19.811302700Z' has failed with following error code '2147942432' (The process cannot access the file because it is being used by another process.). Please review the event details
    for a solution, and then rerun the backup operation once the issue is resolved.
    Fault bucket 659897467, type 5
    Event Name: WindowsBackupFailure
    Response: Not available
    Cab Id: 0
    Problem signature:
    P1: Backup
    P2: 6.1.7600
    P3: 0x80070020
    P4: 7
    P5:
    P6:
    P7:
    P8:
    P9:
    P10:
    Attached files:
    C:\Windows\Logs\WindowsBackup\WindowsBackup.1.etl
    These files may be available here:
    C:\ProgramData\Microsoft\Windows\WER\ReportArchive\NonCritical_Backup_6957d65de91fc4a853ecc7c78914bf7351fff0d1_14578325
    Analysis symbol:
    Rechecking for solution: 0
    Report Id: dd480bf2-56a6-11e0-ae81-00217099bf56
    Report Status: 0
    From Report.wer  in  C:\ProgramData\Microsoft\Windows\WER\ReportArchive\NonCritical_Backup_6957d65de91fc4a853ecc7c78914bf7351fff0d1_14578325
    Version=1
    EventType=WindowsBackupFailure
    EventTime=129455071508181139
    Consent=1
    UploadTime=129455071508201140
    ReportIdentifier=dd480bf2-56a6-11e0-ae81-00217099bf56
    Response.BucketId=659897467
    Response.BucketTable=5
    Response.type=4
    Sig[0].Name=Operation
    Sig[0].Value=Backup
    Sig[1].Name=AppVer
    Sig[1].Value=6.1.7600
    Sig[2].Name=HRESULT
    Sig[2].Value=0x80070020
    Sig[3].Name=TargetType
    Sig[3].Value=7
    DynamicSig[1].Name=OS Version
    DynamicSig[1].Value=6.1.7600.2.0.0.256.48
    DynamicSig[2].Name=Locale ID
    DynamicSig[2].Value=1033
    State[0].Key=Transport.DoneStage1
    State[0].Value=1
    State[1].Key=DataRequest
    State[1].Value=Bucket=659897467/nBucketTable=5/nResponse=1/n
    FriendlyEventName=WindowsBackupFailure
    ConsentKey=WindowsBackupFailure
    AppName=Windows host process (Rundll32)
    AppPath=C:\Windows\System32\rundll32.exe
    ReportDescription=Windows Backup failure

  • How do I fix this error: DF024: Unable to preserve original file at ... Error 32 The process cannot access the file because it is being used by another process.(Seq 1352).  ?

    I am installing creative the cloud Illustrator desktop app on a machine with windows 7 64 bit running in a domain environment.  The download starts and takes about runs for a bout 10 minutes and then stops with the error: DF024: Unable to preserve original file at "C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows\AdobeLinguistic.dll" Error 32 The process cannot access the file because it is being used by another process.(Seq 1352)
    I am logged in as a network administrator and there are no other apps except a web browser (Chrome) running.  There are no other users logged into the machine.
    How can I see what other process is using the needed file so that I can fix it?
    Thanks

    MelissaB34 it looks like you already are reviewing your installation log files but you can find more information at Troubleshoot install issues with log files | CC - http://helpx.adobe.com/creative-cloud/kb/troubleshoot-install-logs-cc.html.  From the error you have posted it appears that your current User account is either unable to update C:\Program Files\Adobe\Adobe Illustrator CC 2014\Support Files\Contents\Windows\AdobeLinguistic.dll or does not have sufficient file permissions to do so.  Since you mentioned you are on a domain please ensure that you are working with your I.T. department and have correct access to this directory.
    You may want to also consider logging in under a local administrator account to see if you face the same difficulties.  This would help you determine if you are facing a file corruption issue or file permission issue.

  • I get a message saying that "Excel cannot open the file

    Every now and then, when I try opening an Excel file, I get a message saying that "Excel cannot open the file 'file.xlsx' because the file format or the file extension is not valid. Verify that the file has not been corrupted and that the file extension
    matches the format of the file.

    I see this most often when a file has been transferred around a lot and gets corrupted due to bad sectors on hard drives, 
    bad thumb drives, etc...
    Occasionally, I find a repair utility that will....kind of....fix it. You tend to lose all formatting and usually the user 
    would have to spend more time doing than life than simply starting from scratch. If on a file server, shadow copies
    (previous versions) are a god send.
    If it happens completely randomly, does it happen more often to the same group of people? Perhaps an update malfunctioned? 
    Reinstall Office? Try XLSX Open File Tool for recovery your documents (http://www.xlsx.openfiletool.com/)
    There could be so many reasons this could happen, but all the above is where I'd start.
    Also read this
    https://groups.google.com/forum/#!topic/xlsx-viewer-download/Yf8eudHMWv8

  • Excel cannot open the file beacuse the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file [help]

    Hi,
    I have a excel file that I have been using since beginning of year.
    Yesterday, I tried to open it but a message comes out "
    Excel cannot open the file beacuse the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file"
    After I click yes, the page is blank. The file is about 400kb in size.
    I have try open and repair and third party repair program and not working also.
    I would appreciate a lot if you can help me.
    Thank you very much.

    Per your post, this problem might be caused by malware on the affected machine.
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx
    In order to clean your machine, run Microsoft Safety Scanner (http://www.microsoft.com/security/scanner/en-us/default.aspx) to kill the malware, and then repair Excel file itself.
    If this is not the case, feel free to post back and let me know. Thanks.
    Tony Chen
    TechNet Community Support
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • While deleting the virtual machine .vhd folder -- error msg : the process cannot access the file beacuse it is being used by another process

    When i am trying to delete the Virtual Machine folder/directory i get the below error. Virtual machine is turned off
    V:\>rmdir ME-EXCAS01 /s
    ME-EXCAS01, Are you sure (Y/N)? y
    ME-EXCAS01\ME-EXCAS01\Virtual Machines\1B1FD14E-B3F0-4232-9F96-2A871E879CD6.xml
    - The process cannot access the file because it is being used by another process
    How to delete the whole folder ?
    Thanks

    Also, if your VM has snapshots and you delete it, you must wait for the snapshots to finish merging - the VHD files will be locked until then.
    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.

Maybe you are looking for

  • Bursting a PDF Template is not working correctly

    We are using a PDF template for an export document and we are bursting the request so that we can send the output to multiple destinations. This all works correctly until we hit a document that results in multiple pages. This results in the generated

  • IPhoto pictures as file attachments in email

    Does anyone know how to attach picture files from iPhoto in an email. No matter what I try, the picture gets imbedded in the email instead of as a file attachment. I am new to Apple and Mac having done Windows all my life. Thank you.

  • Apply validations on internal table fields before updating table

    I have to upload data from a CSV file to R3 ztable, but before that I have to apply diffrent validations to check if fileds does not contaion invalid characters .... eg for a currency field I want to check if user has entered value in decimail format

  • Diplay data in function module

    Hi I am extracting data for PLANT MAINTAINENCE application, it is in master data. Data contains in 8 tables .and display 12 fields in the report and i have to extract data in BW side. So i am using function module to extract the data from R/3 to BW s

  • Problem in Tax Code Execution

    Hi, Can any one please explain me where i am going wrong in customisation for tax code (CIN). the message given in error is  "<b>No posting rules have been defined for the account key in the tax table  in table T007B</b>".