Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Unable to connect to Outlook when debugging in VS2010

$
0
0

I have several applications that communicate with Excel and Outlook vis COM.  These applications work fine when running stand-alone.  However, when debugging under VS2010, connecting to Excel will always start a new instance and I am unable to connect to Outlook at all.

My code to communicate with Outlook is as follows:

try
{
  ol = (Microsoft.Office.Interop.Outlook.Application)System.Runtime.InteropServices.Marshal.GetActiveObject("Outlook.Application");
}
catch
{
  try
  {
    ol = new Microsoft.Office.Interop.Outlook.Application( );
  }
  catch(System.Exception ex)
  {
    MessageBox.Show("Error starting Outlook - " + ex.Message, "Critical Error", MessageBoxButtons.OK,
				 MessageBoxIcon.Error);

Under the debugger in VS2010, I always get a CO_E_SERVER_EXEC_FAILURE message.

I will add that I do not have administrative privleges on my development machine.


James M. Culpepper


Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>