Excel Issues

  • 12 years ago

    I have a referrence to Excel 12.0 Object Library in my application. I have made the visible set to false for Excel and doing all my work. When iam trying to terminate the excel while application termination it is closing all the other opened excel workbooks.

    Please give a solution.

    The code is somewhat like this:


              Dim pProcess As Process

             exlHandle = oexcel.Hwnd

             GetWindowThreadProcessId(exlHandle, exlProcessId)

             pProcess = System.Diagnostics.Process.GetProcessById(exlProcessId)


    Catch ex As Exception


    End Try


    Thanks in Advance

    Murali Krishna

  • 12 years ago
    Hi, If you are using the Excel sheet via Com, then you really shouldnt end the process. It would be better to call close on the excel object you created using Com. Excel runs as an MDI application, therefore any new workbooks that open are opened in the running Excel instance. Killing it will kill all other Excel windows. The exception to this is when Excel is started by itself, this will create another Excel container instance, which makes finding out which instance actually hosts your workbook a nightmare and from what i understand, impossible. Regards Si
  • 12 years ago
    For kicks, I decided to set up a Google Alert on the term "patorjk" (my website name if you add a dot com) and got an alert about this webposting. My first thought was "oh wow, another patorjk". However, I looked at your profile info and it says your name is "Patrick Gillespie" and that you are from Baltimore. There's close to a zero chance that there's another Patrick Gillespie from Baltimore, who programs in VB, that decided to use the online pseudonym "patorjk". Why is it that you decided to use my online pseudonym and why sign up for an online account with my information? That's very creepy from my perspective. It looks like you set up the account 7 months ago and made posts with no signature, but then since one month ago you've started identifying yourself as "Murali Krishna". I'd appreciate it if you would discontinue your use of this account and create one that actually represents yourself. Google Cache page of you saying your "Patrick Gillespie" from Baltimore:

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”