VS.net 2003: Excel error

WtFudgE

New member
Joined
Mar 11, 2005
Messages
4
Programming Experience
Beginner
I'm getting this error:
--------------------
An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsApplication1.exe

Additional information: Old format or invalid type library.
-------------------------
I created a simplified code just to check if I could check my error,
here's my simplified code:
------------------------
Imports Excel

Public Class Form1
Inherits System.Windows.Forms.Form

Windows Form Designer generated code

Public xlToepassing As New Application
Public xlBook As Workbook
Public xlBlad As Worksheet

Public mstrBestand As String

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

mstrBestand = "c:\tmp\Studenten.xls"

xlBook = xlToepassing.Workbooks.Open(mstrBestand) 'HERE IS THE ERROR
xlBlad = xlToepassing.ActiveSheet

End Sub
End Class
----------------------
My project worked fine in school, but when I came home, I made a refference to Excel, and for some reason my program didn't work.
Don't worry about the location of my file, it's correct, I just used a simple way (c: etc) to check my error instead of openfiledialogs.
This sux since i have to finish my assignment next wednesday.

All the help is usefull! Thank :)
 
Back
Top