Questions tagged [comexception]

COMException is a .NET exception and is thrown when an unrecognized HRESULT is returned from a COM method call.

COMException is a .NET exception and is thrown when an unrecognized HRESULT is returned from a COM method call. COMException is the base class for a set of predefined, standard exceptions.

225 questions
2
votes
1 answer

Issue with Interop.SQLXMLBULKLOADLib.dll

I converted an old dts package into SSIS package and trying to run it Windows 2008 server. This SSIS package runs an Win32 exe file which is using Interop.SQLXMLBULKLOADLib.dll and trying to load some XML data into database. But i get following…
Phoenix
  • 411
  • 4
  • 9
  • 22
2
votes
2 answers

How to handle HRESULTs in Outlook addin?

Based on this SO answer: Catching COMException specific Error Code, I'd like to know, to properly handle COMExceptions across OSs and multiple versions of OL, if I need to only look at a specific portion of the exception. For example, private const…
wes
  • 1,577
  • 1
  • 14
  • 32
2
votes
1 answer

What causes a COMException with the message "Cannot access 'System.IO.MemoryStream'" to be thrown?

I'm trying to export a DataTable to Microsoft Excel 2016 and I got my code to "successfully" run through once. When it did run, and I tried to open the Excel file, it told me that the file format was invalid (trying to export to XLSX). That's…
Hazel へいぜる
  • 2,751
  • 1
  • 12
  • 44
2
votes
3 answers

How to handle System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

I am developing a Windows application where I manipulate Word Application. More specific, I am opening a Word Document but when I quit it and try to open another Word Document this Error comes out. How to handle…
Tsal Giorgos
  • 390
  • 3
  • 16
2
votes
0 answers

C# COMException: Cannot call a from within an event

I have a winform (MyFrm) which contains a winforms user control (myWinformUserControl). I call a public method (MyMethod) from this user control: using (var frm = new MyFrm()) { frm.myWinformUserControl.MyMethod(); } public class…
Willy
  • 9,848
  • 22
  • 141
  • 284
2
votes
1 answer

Getting error popup when an website solution opened in Visual Studio 2017

I am getting below error when a website solution is opened in Visual Studio 2017 System.Runtime.InteropServices.COMException (0x80041FEC): Exception from HRESULT: 0x80041FEC at…
2
votes
0 answers

Debugging COMException

I am using an ancient Intergraph routing library to do some routing. I could create several ActiveX and COM objects just fine but there is this one type "Location" and "LocationCtrl" that throws a COMException on creation. Here's the relevant…
chakrit
  • 61,017
  • 25
  • 133
  • 162
2
votes
0 answers

The object does not support this method, when updating recurring appointment in Outlook

I'm having an issue updating a recurring Appointment using Outlook's API. I keep receiving a COMException stating, System.Runtime.InteropServices.COMException (0x90720009): The object does not support this method. at…
2
votes
0 answers

C# Microsoft.Office.Interop.Excel.Range.CopyPicture works on some computers but not on others

I'm trying to copy a picture of the selected Excel Range to Clipboard and show that Bitmap on my GUI. I have this method to get the Bitmap: using Excel = Microsoft.Office.Interop.Excel; public static Bitmap CopyPicture(ref Excel.Range range) { …
Tuomas Kiiski
  • 21
  • 1
  • 3
2
votes
1 answer

Excel application thows an exception on setting width

I am trying to control the Excel application via a WPF project. var xla = new Microsoft.Office.Interop.Excel.Application(); xla.Width = 400; // This line is throwing the below exception. It works fine for few times, after few days the same line…
kaliprasad
  • 11
  • 6
2
votes
1 answer

The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))

I have an application which opens an Visio file .VSD and copies some jpeg images onto the VSD file. I am using Visio 2013, it works fine with this version but I have another client machine where I have only exe of this application(not complete code…
Puneeth
  • 419
  • 1
  • 6
  • 18
2
votes
0 answers

COMException thrown when executing DLL method from separate thread in .NET 4.5.2

I have a .NET service that references XpdfPrint.dll that is used for printing. The print method of XpdfPrint library is executed in separate thread that looks like this: Thread xPdfPrintThread = new Thread(() => { try { …
Srki Rakic
  • 499
  • 5
  • 15
2
votes
2 answers

COMException when too many outlook files were opened

Short question: how to close outlook items properly after using them? Code to reproduce the problem: Dim olApp As New Microsoft.Office.Interop.Outlook.Application Dim olSelection As Microsoft.Office.Interop.Outlook.Selection =…
Breeze
  • 2,010
  • 2
  • 32
  • 43
2
votes
1 answer

NAudio: "Unable to instantiate ASIO. Check if STAThread is set"

I'm attempting to route microphone audio into the speakers in NAudio, using ASIO drivers. I have been successful in the NAudio demo project. Copying this code over to a different project (XNA, if relevant) is causing a COMException every time. …
SFX
  • 169
  • 11
2
votes
1 answer

WinRT WebView IUriToStreamResolver causes COMException for some urls

I am trying to add some caching to a WebView for a Windows Phone 8.1 WinRT application. I am using the new IUriToStreamResolver to get streams for certain urls and this works OK most of the time. For some urls I get the following exception…
Gluip
  • 2,917
  • 4
  • 37
  • 46