I still havent got the first posts code but I am making progress on these parts but still having trouble converting.
VB Code:
private object moApp; private System.Type moAppType; /// Create the late bound app object moAppType = System.Type.GetTypeFromProgID("Excel.Application"); object moApp = System.Activator.CreateInstance(moAppType); /// ... /// Closing of form but this line wont work for late binding if ((moApp.Workbooks.Count) > 0) /// So I converted it to this but not working if (moAppType.InvokeMember("Workbooks.Count", System.Reflection.BindingFlags.GetProperty, null, moApp, null) > 0) [Error: Operator '>' cannot be applied to operands of type 'object' and 'int']





Reply With Quote