I have a program I wrote a few years ago that interfaces largely with MS Excel. At the time my company used Office 2007. We have since upgraded to 2010 with no problems. However, I had to make some adjustments, and now I can not compile. The error is

Error 3 Type 'Microsoft.Office.InteropExcel.Application' is not defined. P:\ASG\VB Backup\Current Programs\ALL SUS TRAINING\WindowsApplication2\Form1.vb 5 23 WindowsApplication2

My code below is the header I've used since first release.

Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel

Public Class frmImportDoc
    Dim trFile As New Microsoft.Office.InteropExcel.Application
    Dim trSheet As New Microsoft.Office.InteropExcel.Worksheet

So far, I have tried deleting and re-importing all of the office references (both Office and Excel Object Libraries).

If anyone has any ideas on this, I would greatly appreciate the help!

Recommended Answers

All 2 Replies

Be sure to reference the library in the project.

Go to My Project > References > Add New > Navigate to the correct verison (14.0 I think) then add.

@Begginerdev, I looked at the object libraries earlier, but didn't check the version. I had v11.0 installed. Also, after talking to one of our IT guys, when they released Office to be installed on the computers here, the PIAs were stored on the network, not the local computers - I guess not everyone needs to worry about software development! I went to Microsoft and downloaded & installed the files myself (link below). Then removed all current references, and added the new ones. Now it works. Thanks!

MS Office Excel PIA Redistributable

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.