Unable to cast object of type 'System.__ComObject' to type 'Microsoft.Office.Interop.Outlook.ApplicationClass '
We get this error only in one of our users PC with office 2003 we tried re
Reinstalling the Office 2003 Primary InterOp Assemblies also. Why should
this happen in only one users desktop when we have this add-in running on
100 of other workstation ?
Microsoft.Office.Interop.Outlook.Application oApplication = null;
try
{
comboBox_Folder.Items.Clear();
Type oType = Type.GetTypeFromProgID("Outlook.Application");
if (oType != null)
oApplication =
(Microsoft.Office.Interop.Outlook.Application)Acti vator.CreateInstance(oType);
Unable to cast object of type 'System.__ComObject' to type
'Microsoft.Office.Interop.Outlook.ApplicationClass '.
at
System.Runtime.Remoting.RemotingServices.AllocateU ninitializedObject(RuntimeType
objectType)
at
System.Runtime.Remoting.RemotingServices.AllocateU ninitializedObject(Type
objectType)
at
System.Runtime.Remoting.Activation.ActivationServi ces.CreateInstance(Type
serverType)
at
System.Runtime.Remoting.Activation.ActivationServi ces.IsCurrentContextOK(Type
serverType, Object[] props, Boolean bNewObj)
at System.RuntimeTypeHandle.CreateInstance(RuntimeTyp e type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle&
ctor, Boolean& bNeedSecurityCheck)
at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache)
at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache)
at System.Activator.CreateInstance(Type type, Boolean nonPublic)
TIA
John
|