Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Checking whether Excel is installed on the machine.

Checking whether Excel is installed on the machine.

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi all, How can my VB.NET program checks whether the MS Excel is installed on the machine. Is there any .NET library that let me to check whether particular application is installed on the computer? Thanks in advance.

    N 1 Reply Last reply
    0
    • L Lost User

      Hi all, How can my VB.NET program checks whether the MS Excel is installed on the machine. Is there any .NET library that let me to check whether particular application is installed on the computer? Thanks in advance.

      N Offline
      N Offline
      Nicholas Cardi
      wrote on last edited by
      #2

      You could do one of two things. 1) You could search for the installed files. Excel.exe 2) You could try an instance the excel object via com. Forever Developing

      U 1 Reply Last reply
      0
      • N Nicholas Cardi

        You could do one of two things. 1) You could search for the installed files. Excel.exe 2) You could try an instance the excel object via com. Forever Developing

        U Offline
        U Offline
        User 722891
        wrote on last edited by
        #3

        Hi, I would like to try the second approach. However, how do I know I failed to create the COM instance is the error that the machine is not installed the MS Excel? Thanks for replying.

        D 1 Reply Last reply
        0
        • U User 722891

          Hi, I would like to try the second approach. However, how do I know I failed to create the COM instance is the error that the machine is not installed the MS Excel? Thanks for replying.

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          Put the code in a Try/Catch block! Believe me, if Excel is not installed, it'll bomb as soon as you try to create the object. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          U 1 Reply Last reply
          0
          • D Dave Kreskowiak

            Put the code in a Try/Catch block! Believe me, if Excel is not installed, it'll bomb as soon as you try to create the object. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            U Offline
            U Offline
            User 722891
            wrote on last edited by
            #5

            Thanks for reply. But there are many possible reasons for failing to create an instance of COM in TRY .. CATCH... How do I know that error is caused by the MS Excel not installed?

            D 1 Reply Last reply
            0
            • U User 722891

              Thanks for reply. But there are many possible reasons for failing to create an instance of COM in TRY .. CATCH... How do I know that error is caused by the MS Excel not installed?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Yes there are and that's why you check for the exception type in the Catch code. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups