Hi, Can't answer the first question but the second one is easy,
you have to call this function , System.Runtime.InteropServices.Marshal.ReleaseComObject(object), for ever reference to an object that you have used, this can become quite messy, so try to use as few objects as possible. Dave, On 4/3/07, Jason <[EMAIL PROTECTED]> wrote:
Howdy All, Hit an Excel snag... I'm using the PIA to interface with Excel. There are two problems that I'm facing... 1. Upon showing the excel application, the mouse doesn't seem to respond to the application (ie. you can't scroll or click on cells, or change tabs). You can use the mouse AFTER you start typing... and at that point, excel thinks you're making a change to the currently highlighted cell. Is there a way to 'activate' and force focus on a cell so mouse events are routed directly to excel? (I think i've tried everything... that seemed obvious). I'm pretty sure that the excel application also has focus. 2. When I invoke the Quit method... sometimes excel crashes and displays the usual excel crash dialog (with buttons to send the error to microsoft). This is intermittent, and I don't really know what I'm doing wrong here. I'm releasing every single COM object that I have ... or at least I think I am... is there a way to diagnose what's going on here? I close every workbook and then quit excel... but nothing I do seems to help. Is there a way to make exiting excel robust? Note that excel is hosted on a .NET form. Attaching the excel window to the .NET panel is done using native calls via the user32.dll (FindWindow, SetParent and sizing is done via SetWindowPos and MoveWindow) =================================== This list is hosted by DevelopMentor(r) http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com
-- Dave Jones [EMAIL PROTECTED] [EMAIL PROTECTED] b1xml2 : "The one thing that is differentiates VB.NET from C# is the horrible ability to do this turn Option explicit and strict off, after which VB.NET can resemble mangled spaghetti. " =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com