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. Unnecessarily opening of excel file vb.net

Unnecessarily opening of excel file vb.net

Scheduled Pinned Locked Moved Visual Basic
csharpquestion
9 Posts 4 Posters 1 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.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    Hi, In my code, after execution of the following code.

    dim d as new Excel.Application

    create an excel instance. and opening an excel file by using the following code.

    d.Workbooks.Open(ExsTemplate & "sheet.xls")

    Now i try to open an excel file by double clicking it, which is lying in my hard drive. this open sheet.xls file also , in the taskbar. Can you tell me why sheet.xls should open? Thanks

    A 1 Reply Last reply
    0
    • P Pankaj Garg

      Hi, In my code, after execution of the following code.

      dim d as new Excel.Application

      create an excel instance. and opening an excel file by using the following code.

      d.Workbooks.Open(ExsTemplate & "sheet.xls")

      Now i try to open an excel file by double clicking it, which is lying in my hard drive. this open sheet.xls file also , in the taskbar. Can you tell me why sheet.xls should open? Thanks

      A Offline
      A Offline
      Anoop Brijmohun
      wrote on last edited by
      #2

      hi, you need to close the excel book in your program. workbooks.close thanks

      P 2 Replies Last reply
      0
      • A Anoop Brijmohun

        hi, you need to close the excel book in your program. workbooks.close thanks

        P Offline
        P Offline
        Pankaj Garg
        wrote on last edited by
        #3

        i HAVE 35-40 LINES OF CODE, before i closes the workbook. and meanwhile user tries to open an excel file, which results in opening the file (Sheet.xls). Any idea?

        D 1 Reply Last reply
        0
        • A Anoop Brijmohun

          hi, you need to close the excel book in your program. workbooks.close thanks

          P Offline
          P Offline
          Pankaj Garg
          wrote on last edited by
          #4

          do u have any idea for the below link http://www.codeproject.com/Messages/3071168/files-names-under-a-process-vb-net-2008.aspx[^]

          A L 2 Replies Last reply
          0
          • P Pankaj Garg

            do u have any idea for the below link http://www.codeproject.com/Messages/3071168/files-names-under-a-process-vb-net-2008.aspx[^]

            A Offline
            A Offline
            Anoop Brijmohun
            wrote on last edited by
            #5

            no idea! :^)

            1 Reply Last reply
            0
            • P Pankaj Garg

              i HAVE 35-40 LINES OF CODE, before i closes the workbook. and meanwhile user tries to open an excel file, which results in opening the file (Sheet.xls). Any idea?

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

              Yep, when you use Excel in your application, this is the rick you take. A use can launch external .xls files by double clicking on them and they will show up in the Excel that you launched in your code. You can't prevent it. So what's the question?

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              P 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Yep, when you use Excel in your application, this is the rick you take. A use can launch external .xls files by double clicking on them and they will show up in the Excel that you launched in your code. You can't prevent it. So what's the question?

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                P Offline
                P Offline
                Pankaj Garg
                wrote on last edited by
                #7

                Should the file get opened in compatibility mode? Which ever file is opening , the compatibility mode text get appending with the file name, until the instance is killed.

                D 1 Reply Last reply
                0
                • P Pankaj Garg

                  Should the file get opened in compatibility mode? Which ever file is opening , the compatibility mode text get appending with the file name, until the instance is killed.

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

                  That depends on the file. I have no idea what you're users are opening, so yes, it's possible.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  1 Reply Last reply
                  0
                  • P Pankaj Garg

                    do u have any idea for the below link http://www.codeproject.com/Messages/3071168/files-names-under-a-process-vb-net-2008.aspx[^]

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Set IgnoreRemoteRequets to True to force excel to open a new instance of excel.exe for each workbook, this may cause undesired behavior and may cause links to not work. Save your sheet when you set ignoreremoterequests to true. This will prevent all worksheets opened programtically when a user opens a workbook from his desktop.

                    Check out the CodeProject forum Guidelines[^]

                    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