none
Have Visual Studio 2015 Community Edition need to work with Excel files RRS feed

  • Question

  • I can't get the references for MS Office or MS Excel to work with Visual Studio 2017 Community Edition. When I try to add the .COM reference for "Microsoft.Office.Interop.Excel"  I can't find it however I can find this: Microsoft Excel 14.0 Object Library (version 1.7) but does not work or not clear my errors. I later found in a web site that Ms Office tools can only work with Visual Studio Professional or something above the "free editions" is this true?. My question now is: Does anyone have an example on how to open and work with Excel files using Visual Studio 2015 Community Edition using Visual Basic Console Applications? Thank you in advance.   

    Tuesday, May 10, 2016 7:42 PM

Answers

  • Hi Javx1,

    >>All I have is an example I found on the internet but I have no clue how it works.

    I assume there are some problems in this example.

    I suggest you create your own project by following the steps below: 

    #How to automate Microsoft Excel from Visual Basic .NET

    https://support.microsoft.com/en-us/kb/301982

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 13, 2016 8:00 AM

All replies

  • I can't get the references for MS Office or MS Excel to work with Visual Studio 2015 Community Edition. When I try to add the .COM reference for "Microsoft.Office.Interop.Excel"  I can't find it however I can find this: Microsoft Excel 14.0 Object Library (version 1.7) but does not work or not clear my errors. I later found in a web site that Ms Office tools can only work with Visual Studio Professional or something above the "free editions" is this true?. My question now is: Does anyone have an example on how to open and work with Excel files using Visual Studio 2015 Community Edition using Visual Basic Console Applications? Thank you in advance.   


    Tuesday, May 10, 2016 7:42 PM
  • Hi Javx1,

    >> does not work or not clear my errors.

    What are your errors? To automate excel in VB console applications, you need to add interop.excel reference. Which Office you installed in your pc? For installing Office PIA, you could refer How to: Install Office Primary Interop Assemblies. It would be helpful if you could share us details about your project and error information.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Wednesday, May 11, 2016 2:28 AM
  • Hello Edward/everyone else too. 

    Please see my responses to each of your questions below in bold.

    What are your errors?

    • Ok I am not that good using VB yet.
    • I am using Visual Studio 2015 Community Edition and it does not recognize the imports “interop.excel”
    • Everything else is pretty much flagged as an error.

    To automate excel in VB console applications, you need to add interop.excel reference.

    • I have tried this with no success, it does not recognize it, I have taken out this reference and used “Microsoft Office 14.0 Object Library” instead, still have errors.

     

    Which Office you installed in your pc?

    • I have Windows 2-10

    For installing Office PIA, you could refer How to: Install Office Primary Interop Assemblies.

    • I have done this last night – and installed based on instructions.

     It would be helpful if you could share us details about your project and error information.

    1. I am trying to read an excel spreadsheet in VB
    2. The project is to read the excel file, find a column with a due date
    3. Check if the due date is within 7-days from the due date
    4. When the date is within the 7-day mark I need to generate an email using a column with the operators email address.
    5. The email should print a message stating their project is due within 7-days from now.

    Notes: All I have is an example I found on the internet but I have no clue how it works. I started by using Visual Basic from an Excel workbook but found that the code disappears for some reason and I have to recode it, so I decided to read the Excel files instead but can’t make it work what I really need is a working example of a VB reading an excel file.

    Thursday, May 12, 2016 2:54 PM
  • Hi Javx1,

    >>All I have is an example I found on the internet but I have no clue how it works.

    I assume there are some problems in this example.

    I suggest you create your own project by following the steps below: 

    #How to automate Microsoft Excel from Visual Basic .NET

    https://support.microsoft.com/en-us/kb/301982

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, May 13, 2016 8:00 AM