Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Open Excel File from VB.NET

Avatar of STP_Martin
STP_Martin asked on
Programming.NET ProgrammingVisual Basic.NET
5 Comments1 Solution488 ViewsLast Modified:

Hope someone can help,

I have written a program that produces a Excel (xls) file, I then want it to open the output Excel file before the programs ends. I have managed to get it to work on my computer which used Excel 2010 but when i load the program onto the client computers who will be using the program the file creates but i get an error message when the program tries to open the file (see attached image) they are using Excel 2000.

I have referenced Microsoft Excel 14.0 already

This is the code i am using (and works on my computer) to open the Excel File

Imports Excel = Microsoft.Office.Interop.Excel

        Dim xlApp As Excel.Application
        Dim xlWorkBook As Excel.Workbook
        Dim xlWorkSheet As Excel.Worksheet

        xlApp = New Excel.ApplicationClass
        xlWorkBook = xlApp.Workbooks.Open("<DataPath>")
        xlWorkSheet = xlWorkBook.Worksheets("<Worksheet Name>")
        xlApp.Visible = True

Any help would be very grateful

 Error shown when opening excel file
Avatar of Jorge Paulino
Jorge PaulinoFlag of Portugal imageIT Pro/Developer
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers