1

Taking a shot in the dark here...

I have a C# .NET Application that unzips a set of .txt files, converts them to .xlsx and uploads them to SharePoint. The application was running when a forced system update was pushed to my computer and the application no longer works. It appears my machine can no longer manipulate excel. We are using Microsoft.Office.Interop.Excel namespace.

Is there anything I can check on my machine itself that could be corrupt and not allow excel to be manipulated? The same code works on an identical machine and had been working for years.

I have reinstalled both the application and Microsoft Office. The error I am getting is below. I can provide additional information on any specific portion of the code but this seems to be a issue with my machine not the code.

System.IO.FileNotFoundException: Could not find file 
'C:\Extracts\alwilliams3\Files\XLSX\TIMESHEET_EXTRACT(26_Jun_17-
1032AM).xlsx'.
File name: 'C:\Extracts\alwilliams3\Files\XLSX\TIMESHEET_EXTRACT(26_Jun_17-1032AM).xlsx'

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 Ionic.Zip.ZipFile.get_ReadStream()
   at Ionic.Zip.ZipFile.ReadIntoInstance(ZipFile zf)
   at Ionic.Zip.ZipFile.Read(String fileName, TextWriter statusMessageWriter, Encoding encoding, EventHandler`1 readProgress)
   at CVS_DailyExtracts_To_Sharepoint.Utils.ExtractFiles(String fileName, String outputDirectory)
   at CVS_DailyExtracts_To_Sharepoint.Form1.ProcessFilesToStagingFolder(UploadFileName b)
   at CVS_DailyExtracts_To_Sharepoint.Form1.button3_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Tourtelot
  • 137
  • 3
  • 15
  • The error is not a Excel one. Excel errors are cryptic COM errors and this is a NET System.IO file not found error: the Excel document of the error doesn't exists. Maybe the previous process failed to create it because the System Update and current execution expects it to be created. – SERWare Jun 28 '17 at 14:58
  • 1
    The answer is with the registry and can be found here https://stackoverflow.com/questions/28066719/unable-to-cast-com-object-of-type-microsoft-office-interop-excel-applicationcla – Tourtelot Jun 28 '17 at 16:51

0 Answers0