none
Reading Excel Cells From VB.NET RRS feed

  • Question

  • Hey guys.
    Before you start yelling at me for not reading the forum before posting, I want to tell you that I've read as much as I can about this and still didn't find the answer to my problem.
    I know it is possible to import the contents od a specific cell from excel to a textbox in VB, but I don't want to extract the data from a specific cell, I want to get the data from the currently selected cell. Before I start knocking on doors for answers, I'd like to know if this is possible.
    For starters, I've loaded the excel file in the VB app, through a WebBrowser Control. If i started with the wrong foot, please correct me and guide my way further on.
    Thanks in advance, 
    Danny
    Thursday, February 19, 2009 8:57 PM

Answers

  • You don't need to load the Workbook into the WebBrowser control. You can launch Excel and open the Workbook and go from there.

    How to automate Microsoft Excel from Visual Basic .NET
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, February 20, 2009 1:18 PM
  • Danny,

    something you might find useful is spreadsheetgear for .net.  it will allow you to work with excel files directly in your vb.net application.  you can use a workbookview on a form to create, save, open, change, etc... excel files.  you can also work with excel files in memory and access the data from a specific sheet, cell or named range.  basically you can do the same you would with automation but without the need to start the excel process.  it is much more efficient and very easy to use.  there is a free version in your registration benefits when you register vb express.  there are many example in the vb express forum and i have many on my website as well.  i also have a sample little project on the tools page called time tracker which uses it.  if you take a look at my easy budget program, it also uses it.  you are welcome to take a look. 

    you may find that you can do everything you need to inside you vb.net application and not rely on excel.  it does not require excel or microsoft office to be installed on the development or users computer.  the dll is redistributed with your application. 

    worth a look.

    Jeff
    FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
    Friday, February 20, 2009 3:58 PM

All replies

  • You don't need to load the Workbook into the WebBrowser control. You can launch Excel and open the Workbook and go from there.

    How to automate Microsoft Excel from Visual Basic .NET
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, February 20, 2009 1:18 PM
  • Danny,

    something you might find useful is spreadsheetgear for .net.  it will allow you to work with excel files directly in your vb.net application.  you can use a workbookview on a form to create, save, open, change, etc... excel files.  you can also work with excel files in memory and access the data from a specific sheet, cell or named range.  basically you can do the same you would with automation but without the need to start the excel process.  it is much more efficient and very easy to use.  there is a free version in your registration benefits when you register vb express.  there are many example in the vb express forum and i have many on my website as well.  i also have a sample little project on the tools page called time tracker which uses it.  if you take a look at my easy budget program, it also uses it.  you are welcome to take a look. 

    you may find that you can do everything you need to inside you vb.net application and not rely on excel.  it does not require excel or microsoft office to be installed on the development or users computer.  the dll is redistributed with your application. 

    worth a look.

    Jeff
    FREE DEVELOPER TOOLS, CODE & PROJECTS at www.srsoft.us Database Code Generator and Tutorial
    Friday, February 20, 2009 3:58 PM